t3404 static check of bad SHA-1 failure
- From
Armin Kunaschik <megabreit@googlemail.com>
- Date
- May 13, 2016, 16:09 UTC
- Message-ID
- <CALR6jEiH6oxq=KXfz1pqOue9VKnkp=S8zNqC4OFmbuhRFFxoMw@mail.gmail.com>
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
fiMaybe 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