1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-05 16:41:01 +01:00

Merge pull request #14672 from NixOS/fix-13948

libfetchers: Fix fetchGit with ref = "HEAD"
This commit is contained in:
John Ericson 2025-11-30 01:03:01 +00:00 committed by GitHub
commit 3a32039508
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -836,7 +836,7 @@ struct GitInputScheme : InputScheme
auto fetchRef = getAllRefsAttr(input) ? "refs/*:refs/*"
: input.getRev() ? input.getRev()->gitRev()
: ref.compare(0, 5, "refs/") == 0 ? fmt("%1%:%1%", ref)
: ref == "HEAD" ? ref
: ref == "HEAD" ? "HEAD:HEAD"
: fmt("%1%:%1%", "refs/heads/" + ref);
repo->fetch(repoUrl.to_string(), fetchRef, shallow);