X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=hooks%2Fpost-checkout-touch;h=713395f2fb7eb54db24e2def67e0962b73bc450e;hb=4428ea67f1241e00b12b45b416a646f0fc28fb1d;hp=5bd00a273dba1a064c60e8f4351b14441fd58c12;hpb=51766cb4058a3e94e402cc33d9bd903633a245d1;p=git-scripts.git diff --git a/hooks/post-checkout-touch b/hooks/post-checkout-touch index 5bd00a2..713395f 100755 --- a/hooks/post-checkout-touch +++ b/hooks/post-checkout-touch @@ -1,6 +1,6 @@ #!/bin/sh -# post-checkout hook that change timestamps on files to that one of the commit +# post-checkout hook that changes timestamps on files to that one of the commit # if branch was changed prev_HEAD="$1" @@ -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