about summary refs log tree commit diff
path: root/pkgs/build-support/fetchgit/nix-prefetch-git
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2016-07-04 14:34:24 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2016-07-04 14:39:47 +0200
commit68205d0adeefa7ed5a3627f5d5c47e7a33b93f86 (patch)
treef5492d6347d7b9526360083199ea8976c10087e9 /pkgs/build-support/fetchgit/nix-prefetch-git
parent03fcbf631740a5469df63076ef0a982057d679ef (diff)
downloadnixlib-68205d0adeefa7ed5a3627f5d5c47e7a33b93f86.tar
nixlib-68205d0adeefa7ed5a3627f5d5c47e7a33b93f86.tar.gz
nixlib-68205d0adeefa7ed5a3627f5d5c47e7a33b93f86.tar.bz2
nixlib-68205d0adeefa7ed5a3627f5d5c47e7a33b93f86.tar.lz
nixlib-68205d0adeefa7ed5a3627f5d5c47e7a33b93f86.tar.xz
nixlib-68205d0adeefa7ed5a3627f5d5c47e7a33b93f86.tar.zst
nixlib-68205d0adeefa7ed5a3627f5d5c47e7a33b93f86.zip
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>.
Diffstat (limited to 'pkgs/build-support/fetchgit/nix-prefetch-git')
-rwxr-xr-xpkgs/build-support/fetchgit/nix-prefetch-git4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git
index 1a54f7351c5a..705d84c648bf 100755
--- a/pkgs/build-support/fetchgit/nix-prefetch-git
+++ b/pkgs/build-support/fetchgit/nix-prefetch-git
@@ -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"