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.
This commit is contained in:
parent
087f268615
commit
0479db934c
1 changed files with 4 additions and 2 deletions
|
@ -798,8 +798,10 @@ struct GitInputScheme : InputScheme
|
|||
auto rev = repoInfo.workdirInfo.headRev.value_or(nullRev);
|
||||
|
||||
input.attrs.insert_or_assign("rev", rev.gitRev());
|
||||
input.attrs.insert_or_assign("revCount",
|
||||
rev == nullRev ? 0 : getRevCount(*input.settings, repoInfo, repoPath, rev));
|
||||
if (!getShallowAttr(input)) {
|
||||
input.attrs.insert_or_assign("revCount",
|
||||
rev == nullRev ? 0 : getRevCount(*input.settings, repoInfo, repoPath, rev));
|
||||
}
|
||||
|
||||
verifyCommit(input, repo);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue