Skip to content

Commit

Permalink
Fix wrong hint when deleting a branch successfully from pull request …
Browse files Browse the repository at this point in the history
…UI (#22673) (#22698)

Backport #22673

Fix #18785

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
yardenshoham and lunny authored Feb 1, 2023
1 parent 6dc16c1 commit 263d06f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion routers/web/repo/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,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):
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/pull_merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}

Expand Down

0 comments on commit 263d06f

Please sign in to comment.