mirror of
https://github.com/NixOS/nix
synced 2025-06-30 11:43:15 +02:00
Add a test for shallow Git clones
Also, don't return a revCount anymore for shallow or dirty Git trees, since it's incorrect. Closes #2988.
This commit is contained in:
parent
34c7645a58
commit
fbcb897e21
3 changed files with 21 additions and 6 deletions
|
@ -67,8 +67,9 @@ static void prim_fetchGit(EvalState & state, const Pos & pos, Value * * args, Va
|
|||
auto rev2 = input2->getRev().value_or(Hash(htSHA1));
|
||||
mkString(*state.allocAttr(v, state.symbols.create("rev")), rev2.gitRev());
|
||||
mkString(*state.allocAttr(v, state.symbols.create("shortRev")), rev2.gitShortRev());
|
||||
assert(tree.info.revCount);
|
||||
mkInt(*state.allocAttr(v, state.symbols.create("revCount")), *tree.info.revCount);
|
||||
// Backward compatibility: set 'revCount' to 0 for a dirty tree.
|
||||
mkInt(*state.allocAttr(v, state.symbols.create("revCount")),
|
||||
tree.info.revCount.value_or(0));
|
||||
v.attrs->sort();
|
||||
|
||||
if (state.allowedPaths)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue