Use $NIX_PREFETCH_GIT_CHECKOUT_HOOK to produce a `.git-version' file.

This commit is contained in:
Ludovic Courtès 2009-11-18 16:25:47 +00:00
parent f55e0444c9
commit cdfc96194c

View file

@ -238,6 +238,7 @@ sub fetchInputGit {
print STDERR "checking out Git input from $uri"; print STDERR "checking out Git input from $uri";
$ENV{"NIX_HASH_ALGO"} = "sha256"; $ENV{"NIX_HASH_ALGO"} = "sha256";
$ENV{"PRINT_PATH"} = "1"; $ENV{"PRINT_PATH"} = "1";
$ENV{"NIX_PREFETCH_GIT_CHECKOUT_HOOK"} = "git describe > .git-version";
my $stdout; my $stderr; my $stdout; my $stderr;
(my $res, $stdout, $stderr) = captureStdoutStderr( (my $res, $stdout, $stderr) = captureStdoutStderr(
"nix-prefetch-git", $uri); "nix-prefetch-git", $uri);