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.
This commit is contained in:
David Leadbeater
2025-12-11 17:18:19 +11:00
parent 132d093021
commit a9cf69c04a
+1 -1
View File
@@ -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,