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:
parent
ac328b88d8
commit
93322ab94f
1 changed files with 7 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue