diff options
author | Michael W. Olson <mwolson@gnu.org> | 2007-10-15 13:48:27 -0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-10-16 00:59:17 -0400 |
commit | 2858028e1ab6c79f39ec0057d2034bcbe9f47cf9 (patch) | |
tree | cb2d7daa1a7a0388421b6ff856061b0661dff6f6 /git-rebase--interactive.sh | |
parent | Merge branch 'maint' (diff) | |
download | tgif-2858028e1ab6c79f39ec0057d2034bcbe9f47cf9.tar.xz |
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>
Diffstat (limited to 'git-rebase--interactive.sh')
-rwxr-xr-x | git-rebase--interactive.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index df4cedb859..0dd77b4005 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -110,7 +110,7 @@ pick_one () { parent_sha1=$(git rev-parse --verify $sha1^) || die "Could not get the parent of $sha1" current_sha1=$(git rev-parse --verify HEAD) - if test $no_ff$current_sha1 = $parent_sha1; then + if test "$no_ff$current_sha1" = "$parent_sha1"; then output git reset --hard $sha1 test "a$1" = a-n && output git reset --soft $current_sha1 sha1=$(git rev-parse --short $sha1) |