]> git.phdru.name Git - git-scripts.git/blobdiff - hooks/post-checkout-touch
Set timestamp only on the files known to git
[git-scripts.git] / hooks / post-checkout-touch
index b91425a4260505325ca8970317ae6b657e3cf5d5..713395f2fb7eb54db24e2def67e0962b73bc450e 100755 (executable)
@@ -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