From: Oleg Broytman Date: Wed, 6 Aug 2014 21:46:41 +0000 (+0400) Subject: Set timestamp only on the files known to git X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=4428ea67f1241e00b12b45b416a646f0fc28fb1d;p=git-scripts.git Set timestamp only on the files known to git --- diff --git a/hooks/post-checkout-touch b/hooks/post-checkout-touch index b91425a..713395f 100755 --- a/hooks/post-checkout-touch +++ b/hooks/post-checkout-touch @@ -9,7 +9,7 @@ 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" '{}' \+ + touch --date="$commit_date" `git ls-files --cached` fi exit 0