From 68205d0adeefa7ed5a3627f5d5c47e7a33b93f86 Mon Sep 17 00:00:00 2001 From: Bjørn Forsman Date: Mon, 4 Jul 2016 14:34:24 +0200 Subject: 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 . --- pkgs/build-support/fetchgit/nix-prefetch-git | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/build-support/fetchgit/nix-prefetch-git') 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" -- cgit 1.4.1