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)

Fix #18785
  • Loading branch information
lunny committed Jan 31, 2023
1 parent f1f0430 commit cc91001
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 @@ -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):
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 cc91001

Please sign in to comment.