summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 79882c2)
raw | patch | inline | side by side (parent: 79882c2)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 2 Sep 2005 17:53:15 +0000 (10:53 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 2 Sep 2005 17:53:15 +0000 (10:53 -0700) |
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 <junkio@cox.net>
[: ==: 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 <junkio@cox.net>
git-resolve-script | patch | blob | history | |
git-status-script | patch | blob | history | |
templates/hooks--update | patch | blob | history |
diff --git a/git-resolve-script b/git-resolve-script
index 7c0e3d8aa8f7e63d1e98b79612844043a8481011..000cbb85e3ffd4be739ce0791d1afa59832aa734 100755 (executable)
--- a/git-resolve-script
+++ b/git-resolve-script
die "Unable to find common commit between" $merge $head
fi
-if [ "$common" == "$merge" ]; then
+case "$common" in
+"$merge")
echo "Already up-to-date. Yeeah!"
dropheads
exit 0
-fi
-if [ "$common" == "$head" ]; then
+ ;;
+"$head")
echo "Updating from $head to $merge."
git-read-tree -u -m $head $merge || exit 1
echo $merge > "$GIT_DIR"/HEAD
git-diff-tree -p $head $merge | git-apply --stat
dropheads
exit 0
-fi
+ ;;
+esac
# Find an optimum merge base if there are more than one candidates.
LF='
diff --git a/git-status-script b/git-status-script
index 2b029545de3366d4d51b9060bc31cc6dc97260a5..ee8f7061ea3d327bb4a565f9aaa9cdc04c0fb772 100755 (executable)
--- a/git-status-script
+++ b/git-status-script
#'
fi
-if [ "$committable" == "0" ]
-then
+case "$committable" in
+0)
echo "nothing to commit"
exit 1
-fi
+esac
exit 0
index 0726975367de1bff2d4575537f89f52ff87fa1a7..3f38b82a4710400e512d478ec6b552202a34369f 100644 (file)
--- a/templates/hooks--update
+++ b/templates/hooks--update
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 |