X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=hooks%2Fpost-checkout-touch;h=2c5e625330c5d18b0ce0a50dccb408df4cddc640;hb=cbbebd570fc6d3f3d125893003946b6749d5fb38;hp=713395f2fb7eb54db24e2def67e0962b73bc450e;hpb=4428ea67f1241e00b12b45b416a646f0fc28fb1d;p=git-scripts.git diff --git a/hooks/post-checkout-touch b/hooks/post-checkout-touch index 713395f..2c5e625 100755 --- a/hooks/post-checkout-touch +++ b/hooks/post-checkout-touch @@ -8,7 +8,7 @@ new_HEAD="$2" new_branch="$3" if [ "$new_branch" = 1 ]; then - commit_date="`git show --format='%cD' \"$new_HEAD\" | awk '{if (NR==1) print}'`" && + commit_date="`git show --format='%cD' | head -1`" && touch --date="$commit_date" `git ls-files --cached` fi