mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 23:22:37 +00:00
nix-prefetch-git: unbreak JSON output
This fixes a regression caused by commit f56ab9e
("nix-prefetch-git: Include the date in the machine-readable [...]")
where a couple of directory paths printed by pushd/popd appeared before
the JSON output on stdout (thus breaking it). Fix it by redirecting the
extraneous output to /dev/null.
Reported by Michael Alan Dorman <mdorman@ironicdesign.com>.
This commit is contained in:
parent
03fcbf6317
commit
68205d0ade
@ -288,12 +288,12 @@ _clone_user_rev() {
|
||||
fi;;
|
||||
esac
|
||||
|
||||
pushd "$dir"
|
||||
pushd "$dir" >/dev/null
|
||||
fullRev=$( (git rev-parse "$rev" 2>/dev/null || git rev-parse "refs/heads/$branchName") | tail -n1)
|
||||
humanReadableRev=$(git describe "$fullRev" 2> /dev/null || git describe --tags "$fullRev" 2> /dev/null || echo -- none --)
|
||||
commitDate=$(git show --no-patch --pretty=%ci "$fullRev")
|
||||
commitDateStrict8601=$(git show --no-patch --pretty=%cI "$fullRev")
|
||||
popd
|
||||
popd >/dev/null
|
||||
|
||||
# Allow doing additional processing before .git removal
|
||||
eval "$NIX_PREFETCH_GIT_CHECKOUT_HOOK"
|
||||
|
Loading…
Reference in New Issue
Block a user