Fix wrong hint when deleting a branch successfully from pull request UI (#22673)

Fix #18785
This commit is contained in:
Lunny Xiao 2023-02-01 06:11:48 +08:00 committed by GitHub
parent f1f0430f9f
commit cc910014ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1395,7 +1395,7 @@ func CleanUpPullRequest(ctx *context.Context) {
}
func deleteBranch(ctx *context.Context, pr *issues_model.PullRequest, gitRepo *git.Repository) {
fullBranchName := pr.HeadRepo.Owner.Name + "/" + pr.HeadBranch
fullBranchName := pr.HeadRepo.FullName() + ":" + pr.HeadBranch
if err := repo_service.DeleteBranch(ctx.Doer, pr.HeadRepo, gitRepo, pr.HeadBranch); err != nil {
switch {
case git.IsErrBranchNotExist(err):

View File

@ -187,7 +187,7 @@ func TestPullCleanUpAfterMerge(t *testing.T) {
htmlDoc := NewHTMLParser(t, resp.Body)
resultMsg := htmlDoc.doc.Find(".ui.message>p").Text()
assert.EqualValues(t, "Branch 'user1/feature/test' has been deleted.", resultMsg)
assert.EqualValues(t, "Branch 'user1/repo1:feature/test' has been deleted.", resultMsg)
})
}