[PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux