[PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution
- From
Denton Liu <liu.denton@gmail.com>
- Date
- Sep 18, 2020, 11:19 UTC
- Message-ID
- <ed1ade73281bb78ab3a1d4fd1291a951ca52f0b4.1600427894.git.liu.denton@gmail.com>
- In-Reply-To
- <cover.1600427894.git.liu.denton@gmail.com>
The preferred form for a command substitution is $() over ``. Use this form for the command substitution in the sample hook.
Signed-off-by: Denton Liu <liu.denton@gmail.com> --- templates/hooks--pre-push.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample index 6187dbf439..64b5707553 100755 --- a/templates/hooks--pre-push.sample +++ b/templates/hooks--pre-push.sample @@ -41,7 +41,7 @@ do fi # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` + commit="$(git rev-list -n 1 --grep '^WIP' "$range")" if [ -n "$commit" ] then echo >&2 "Found WIP commit in $local_ref, not pushing"
-- 2.28.0.618.gf4bc123cb7