1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00

fetchGit: don't compute revCount on shallow repository

This can never work and leads to a crash bug.

(cherry picked from commit 0479db934c)

# Conflicts:
#	src/libfetchers/git.cc
This commit is contained in:
Jörg Thalheim 2025-05-26 09:19:40 +02:00 committed by Mergify
parent ac328b88d8
commit 93322ab94f

View file

@ -798,8 +798,15 @@ struct GitInputScheme : InputScheme
auto rev = repoInfo.workdirInfo.headRev.value_or(nullRev);
input.attrs.insert_or_assign("rev", rev.gitRev());
<<<<<<< HEAD
input.attrs.insert_or_assign("revCount",
rev == nullRev ? 0 : getRevCount(repoInfo, repoPath, rev));
=======
if (!getShallowAttr(input)) {
input.attrs.insert_or_assign("revCount",
rev == nullRev ? 0 : getRevCount(*input.settings, repoInfo, repoPath, rev));
}
>>>>>>> 0479db934 (fetchGit: don't compute revCount on shallow repository)
verifyCommit(input, repo);
} else {