mirror of
https://github.com/NixOS/nix.git
synced 2025-11-12 21:46:01 +01:00
Git fetcher: Don't update mtime of ref file if fetching by rev
This fixes the warning
$ nix eval --store /tmp/nix --expr 'builtins.fetchTree { type = "git"; url = "https://github.com/DeterminateSystems/attic"; ref = "fixups-for-magic-nix-cache"; rev = "635753a2069d4b8228e846dc5c09ad361c75cd1a"; }'
warning: could not update mtime for file '/home/eelco/.cache/nix/gitv3/09788h9zgba5lbfkaa6ija2dvi004jwsqjf5ln21i2njs07cz766/refs/heads/fixups-for-magic-nix-cache': error: changing modification time of '"/home/eelco/.cache/nix/gitv3/09788h9zgba5lbfkaa6ija2dvi004jwsqjf5ln21i2njs07cz766/refs/heads/fixups-for-magic-nix-cache"': No such file or directory
When we're fetching by rev, that file doesn't necessarily exist, and we
don't care about it anyway.
(cherry picked from commit b80b091bac)
This commit is contained in:
parent
0f825b38f4
commit
97c5ac5752
1 changed files with 3 additions and 2 deletions
|
|
@ -584,9 +584,10 @@ struct GitInputScheme : InputScheme
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (!input.getRev())
|
||||||
setWriteTime(localRefFile, now, now);
|
setWriteTime(localRefFile, now, now);
|
||||||
} catch (Error & e) {
|
} catch (Error & e) {
|
||||||
warn("could not update mtime for file '%s': %s", localRefFile, e.msg());
|
warn("could not update mtime for file '%s': %s", localRefFile, e.info().msg);
|
||||||
}
|
}
|
||||||
if (!originalRef && !storeCachedHead(repoInfo.url, ref))
|
if (!originalRef && !storeCachedHead(repoInfo.url, ref))
|
||||||
warn("could not update cached head '%s' for '%s'", ref, repoInfo.url);
|
warn("could not update cached head '%s' for '%s'", ref, repoInfo.url);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue