X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=hooks%2Fpost-checkout-touch;h=2c5e625330c5d18b0ce0a50dccb408df4cddc640;hb=2b092d319925e0918f439caaa91c1652bad47d65;hp=b91425a4260505325ca8970317ae6b657e3cf5d5;hpb=950d3b3e506d4805900c2f8c0c416986b7fca444;p=git-scripts.git diff --git a/hooks/post-checkout-touch b/hooks/post-checkout-touch index b91425a..2c5e625 100755 --- a/hooks/post-checkout-touch +++ b/hooks/post-checkout-touch @@ -8,8 +8,8 @@ new_HEAD="$2" new_branch="$3" if [ "$new_branch" = 1 ]; then - commit_date="`git show --format='%cD' \"$new_HEAD\" | awk '{if (NR==1) print}'`" && - find . \( -name .git -type d -prune \) -o -exec touch --date="$commit_date" '{}' \+ + commit_date="`git show --format='%cD' | head -1`" && + touch --date="$commit_date" `git ls-files --cached` fi exit 0