1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02:00

Fetch specific Git revisions

This is more efficient, and necessary when using shallow=1 with a rev.
This commit is contained in:
Eelco Dolstra 2023-11-15 16:15:47 +01:00
parent f450c8773c
commit e4066c0444
2 changed files with 5 additions and 4 deletions

View file

@ -518,8 +518,11 @@ struct GitInputScheme : InputScheme
if (doFetch) {
try {
auto fetchRef = getAllRefsAttr(input)
auto fetchRef =
getAllRefsAttr(input)
? "refs/*"
: input.getRev()
? input.getRev()->gitRev()
: ref.compare(0, 5, "refs/") == 0
? ref
: ref == "HEAD"