From a9cf69c04a2792ac966d007219837d888639efc6 Mon Sep 17 00:00:00 2001 From: David Leadbeater Date: Thu, 11 Dec 2025 17:18:19 +1100 Subject: [PATCH] Ensure the branch parameter really is a branch Currently you can specify "Branch: HEAD" or "Branch: refs/tags/v1" and go-git will resolve it to the relevant ref. Given the HTTP header is called Branch this is confusing. --- src/fetch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetch.go b/src/fetch.go index be89920..133a487 100644 --- a/src/fetch.go +++ b/src/fetch.go @@ -57,7 +57,7 @@ func FetchRepository( repo, err = git.CloneContext(ctx, storer, nil, &git.CloneOptions{ Bare: true, URL: repoURL, - ReferenceName: plumbing.ReferenceName(branch), + ReferenceName: plumbing.NewBranchReferenceName(branch), SingleBranch: true, Depth: 1, Tags: git.NoTags,