diff --git a/internal/gitaly/service/operations/apply_patch.go b/internal/gitaly/service/operations/apply_patch.go index 34cefcd2a65228c8360de860a84068fc6de1b254..7c96008d4629e3bd6df512681b8abcf2785fe9fe 100644 --- a/internal/gitaly/service/operations/apply_patch.go +++ b/internal/gitaly/service/operations/apply_patch.go @@ -72,7 +72,7 @@ func (s *Server) userApplyPatch(ctx context.Context, header *gitalypb.UserApplyP return fmt.Errorf("resolve target branch: %w", err) } - defaultBranch, err := repo.GetDefaultBranch(ctx) + defaultBranch, err := repo.HeadReference(ctx) if err != nil { return fmt.Errorf("default branch name: %w", err) } diff --git a/internal/gitaly/service/operations/apply_patch_test.go b/internal/gitaly/service/operations/apply_patch_test.go index b8dffa014650e045c457057030328e36a8a7a784..bee4faa2894bea5a16f522566ba089c65d4b2f6f 100644 --- a/internal/gitaly/service/operations/apply_patch_test.go +++ b/internal/gitaly/service/operations/apply_patch_test.go @@ -144,30 +144,6 @@ To restore the original branch and stop patching, run "git am --abort". } }, }, - { - desc: "creating a new branch from the first listed branch works", - baseTree: []gittest.TreeEntry{ - {Path: "file", Mode: "100644", Content: "base-content"}, - }, - baseReference: "refs/heads/a", - extraBranches: []string{"refs/heads/b"}, - targetBranch: "new-branch", - patches: []patchDescription{ - { - newTree: []gittest.TreeEntry{ - {Path: "file", Mode: "100644", Content: "patch 1"}, - }, - }, - }, - expected: func(t *testing.T, repoPath string) expected { - return expected{ - branchCreation: true, - tree: []gittest.TreeEntry{ - {Mode: "100644", Path: "file", Content: "patch 1"}, - }, - } - }, - }, { desc: "multiple patches apply cleanly", baseTree: []gittest.TreeEntry{