nix-prefetch-git: fix date field

in some cases `git show` include tag information in the output
this is suppressed by the parameter '-1'
This commit is contained in:
Jörg Thalheim 2016-10-08 19:05:45 +02:00
parent 954d995394
commit 47d0d3d46f
No known key found for this signature in database
GPG Key ID: CA4106B8D7CC79FA

View File

@ -291,8 +291,8 @@ _clone_user_rev() {
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")
commitDate=$(git show -1 --no-patch --pretty=%ci "$fullRev")
commitDateStrict8601=$(git show -1 --no-patch --pretty=%cI "$fullRev")
popd >/dev/null
# Allow doing additional processing before .git removal