X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=hooks%2Fpost-checkout-touch;fp=hooks%2Fpost-checkout-touch;h=aa90936fdd514f9b853657399cb3da603617105c;hb=9b11d48d0ae2f974c73436627528cae5f0506eac;hp=713395f2fb7eb54db24e2def67e0962b73bc450e;hpb=4428ea67f1241e00b12b45b416a646f0fc28fb1d;p=git-scripts.git diff --git a/hooks/post-checkout-touch b/hooks/post-checkout-touch index 713395f..aa90936 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' \"$new_HEAD\" | head -1`" && touch --date="$commit_date" `git ls-files --cached` fi