From 22622c44038f1ba5fa44a33454583f3078b92933 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 10 Aug 2014 17:42:23 +0400 Subject: [PATCH] No need to explicitly show $new_HEAD --- hooks/post-checkout-touch | 2 +- hooks/post-checkout-touch-all | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.2