]> git.phdru.name Git - git-scripts.git/commitdiff
Set timestamp only on the files known to git
authorOleg Broytman <phd@phdru.name>
Wed, 6 Aug 2014 21:46:41 +0000 (01:46 +0400)
committerOleg Broytman <phd@phdru.name>
Wed, 6 Aug 2014 21:46:41 +0000 (01:46 +0400)
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