From 86b13da46cd710a45a89968880c691452d5b70b4 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 2 Sep 2005 10:53:15 -0700 Subject: scripts: equality test '==' is not portable. On NetBSD 3 we trigger an error: [: ==: unexpected operator Double-equal is accepted by bash built-in '[' and bash(1) suggests using '=' for strict POSIX compliance (test(1) from coreutils does not mention '=='). Eradicate their uses everywhere. [jc: Somebody with a pseudonym kindly sent a message to let me know about the problem privately; I do not have access to a NetBSD box.] Signed-off-by: Junio C Hamano --- templates/hooks--update | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/hooks--update b/templates/hooks--update index 0726975367..3f38b82a47 100644 --- a/templates/hooks--update +++ b/templates/hooks--update @@ -16,10 +16,14 @@ then git-rev-list --pretty "$3" else $base=$(git-merge-base "$2" "$3") - if [ $base == "$2" ]; then + case "$base" in + "$2") echo "New commits:" - else + ;; + *) echo "Rebased ref, commits from common ancestor:" + ;; + esac fi git-rev-list --pretty "$3" "^$base" fi | -- cgit v1.2.3