git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* t3404 static check of bad SHA-1 failure
@ 2016-05-13 16:09 Armin Kunaschik
  2016-05-13 18:23 ` Jeff King
  0 siblings, 1 reply; 19+ messages in thread
From: Armin Kunaschik @ 2016-05-13 16:09 UTC (permalink / raw)
  To: Git List

Hello,

in t3404 test 91 - static check of bad SHA-1 fails (with ksh) with a
syntax error in git-rebase.
git-rebase[6]: test: argument expected

Reason is, again, a test -z without quotes in git-rebase--interactive:
*** ../git-rebase--interactive.orig     Tue May 10 17:36:59 2016
--- ../git-rebase--interactive  Fri May 13 17:57:27 2016
***************
*** 870,876 ****
                badsha=1
        else
                sha1_verif="$(git rev-parse --verify --quiet $1^{commit})"
!               if test -z $sha1_verif
                then
                        badsha=1
                fi
--- 870,876 ----
                badsha=1
        else
                sha1_verif="$(git rev-parse --verify --quiet $1^{commit})"
!               if test -z "$sha1_verif"
                then
                        badsha=1
                fi

Maybe it would be a good idea, to quote the test -z $1 in the same
function check_commit_sha too.
The test completes successfully without it, but since it's an user
option, I think it should be quoted.
Then there would be no more unquoted test -z anymore :-)

Armin

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-05-14 19:51 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-13 16:09 t3404 static check of bad SHA-1 failure Armin Kunaschik
2016-05-13 18:23 ` Jeff King
2016-05-13 19:52   ` Junio C Hamano
2016-05-13 19:59     ` Jeff King
2016-05-13 20:02       ` Jeff King
2016-05-13 20:03       ` Junio C Hamano
2016-05-13 20:46         ` [PATCH 0/6] test -z/-n quoting fix + misc cleanups Jeff King
2016-05-13 20:47           ` [PATCH 1/6] t/lib-git-svn: drop $remote_git_svn and $git_svn_id Jeff King
2016-05-13 20:47           ` [PATCH 2/6] t9100,t3419: enclose all test code in single-quotes Jeff King
2016-05-13 20:47           ` [PATCH 3/6] t9107: use "return 1" instead of "exit 1" Jeff King
2016-05-13 22:59             ` Eric Wong
2016-05-13 23:45             ` Eric Sunshine
2016-05-13 23:47               ` Jeff King
2016-05-14 17:37                 ` Junio C Hamano
2016-05-14 19:51                   ` Jeff King
2016-05-13 20:47           ` [PATCH 4/6] t9107: switch inverted single/double quotes in test Jeff King
2016-05-13 20:47           ` [PATCH 5/6] t9103: modernize test style Jeff King
2016-05-13 20:47           ` [PATCH 6/6] always quote shell arguments to test -z/-n Jeff King
2016-05-13 22:09           ` [PATCH 0/6] test -z/-n quoting fix + misc cleanups Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).