From 5b65cb54a9a9d6169c3d3ad085e0fee4874e98e7 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 31 Jan 2023 11:10:00 +0800 Subject: [PATCH 1/2] Fix #18785 --- routers/web/repo/pull.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index c2208120fcf24..71bc98d13d07c 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -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): From 92039ed236c720f6e918443a35d74c10b0404956 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 31 Jan 2023 13:07:28 +0800 Subject: [PATCH 2/2] Fix test --- tests/integration/pull_merge_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/pull_merge_test.go b/tests/integration/pull_merge_test.go index 491fc0e0aafec..e80822a7520af 100644 --- a/tests/integration/pull_merge_test.go +++ b/tests/integration/pull_merge_test.go @@ -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) }) }