{"thread":{"id":"10293","subject":"[PATCH] git-rebase--interactive.sh: Quote arguments to test","startedAt":"2007-10-15T17:48:27Z","lastAt":"2007-10-15T17:48:27Z","messageCount":1,"participants":["Michael W. Olson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"55893","messageId":"87odf0clqs.fsf@hariken.mwolson.org","threadId":"10293","inReplyTo":null,"subject":"[PATCH] git-rebase--interactive.sh: Quote arguments to test","fromName":"Michael W. Olson","fromEmail":"mwolson@gnu.org","sentAt":"2007-10-15T17:48:27Z","receivedAt":"2007-10-15T17:48:27Z","isPatch":true,"sender":{"key":"mwolson@gnu.org","avatar":"https://avatars.githubusercontent.com/u/1510193?v=4"},"body":"If /bin/sh is /bin/dash, then the script will display an error if\n$parent_sha1 is undefined.  This patch works fixes the issue by\nquoting both arguments to `test'.  Arguments composed solely of\nvariable expansions should always be quoted, unless we know for\ncertain that the contents are defined.\n\nSigned-off-by: Michael W. Olson <mwolson@gnu.org>\n---\n\nResending, this time directly to the mailing list instead of via Gmane.\n\n git-rebase--interactive.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 050140d..8a03062 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -110,7 +110,7 @@ pick_one () {\n \tparent_sha1=$(git rev-parse --verify $sha1^) ||\n \t\tdie \"Could not get the parent of $sha1\"\n \tcurrent_sha1=$(git rev-parse --verify HEAD)\n-\tif test $no_ff$current_sha1 = $parent_sha1; then\n+\tif test \"$no_ff$current_sha1\" = \"$parent_sha1\"; then\n \t\toutput git reset --hard $sha1\n \t\ttest \"a$1\" = a-n && output git reset --soft $current_sha1\n \t\tsha1=$(git rev-parse --short $sha1)\n-- \n1.5.3.4\n"}]}