From: Oleg Broytman Date: Sun, 10 Aug 2014 13:42:23 +0000 (+0400) Subject: No need to explicitly show $new_HEAD X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=22622c44038f1ba5fa44a33454583f3078b92933;p=git-scripts.git No need to explicitly show $new_HEAD --- diff --git a/hooks/post-checkout-touch b/hooks/post-checkout-touch index aa90936..2c5e625 100755 --- a/hooks/post-checkout-touch +++ b/hooks/post-checkout-touch @@ -8,7 +8,7 @@ new_HEAD="$2" new_branch="$3" if [ "$new_branch" = 1 ]; then - commit_date="`git show --format='%cD' \"$new_HEAD\" | head -1`" && + commit_date="`git show --format='%cD' | head -1`" && touch --date="$commit_date" `git ls-files --cached` fi diff --git a/hooks/post-checkout-touch-all b/hooks/post-checkout-touch-all index 56ca2f4..2f5e80c 100755 --- a/hooks/post-checkout-touch-all +++ b/hooks/post-checkout-touch-all @@ -8,7 +8,7 @@ new_HEAD="$2" new_branch="$3" if [ "$new_branch" = 1 ]; then - commit_date="`git show --format='%cD' \"$new_HEAD\" | head -1`" && + commit_date="`git show --format='%cD' | head -1`" && find . \( -name .git -type d -prune \) -o -exec touch --date="$commit_date" '{}' \+ fi