mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-08-17 09:26:04 +00:00
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:
+1
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user