git-rebase--interactive.sh: Quote arguments to test
If /bin/sh is /bin/dash, then the script will display an error if $parent_sha1 is undefined. This patch works fixes the issue by quoting both arguments to `test'. Arguments composed solely of variable expansions should always be quoted, unless we know for certain that the contents are defined. Signed-off-by: Michael W. Olson <mwolson@gnu.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Michael W. Olson committed
Oct 15, 2007 at 13:48 UTC
2858028e1ab6c79f39ec0057d2034bcbe9f47cf9
1 file changed
+1
-1
git-rebase--interactive.sh
+1
-1
@@ -110,7 +110,7 @@ pick_one () {
110
parent_sha1=$(git rev-parse --verify $sha1^) ||
111
die "Could not get the parent of $sha1"
112
current_sha1=$(git rev-parse --verify HEAD)
113
- if test $no_ff$current_sha1 = $parent_sha1; then
113
+ if test "$no_ff$current_sha1" = "$parent_sha1"; then
114
output git reset --hard $sha1
115
test "a$1" = a-n && output git reset --soft $current_sha1
116
sha1=$(git rev-parse --short $sha1)