Fix #267, git-missing did not catch branch name.

It was a bug on my setup, the test did no detect the
branch name, so I change:
if [[ $arg != -* ]]; then
by
if [ -n "${arg}" ]; then

According to test man page, -n:
«True if the length of string is non-zero.»

I also added quote and {} around the param,
to prevent bash expension around strange char.
This commit is contained in:
Guillaume Seren 2014-10-14 16:05:52 +02:00
parent 3c7d4e67f4
commit db0f610bc1
No known key found for this signature in database
GPG key ID: 1F285AD22110AAF7

View file

@ -2,9 +2,9 @@
# grab first two non-option arguments
for arg in $*; do
if [[ $arg != -* ]]; then
test -z "$firstbranch" && firstbranch=$arg && continue
test -z "$secondbranch" && secondbranch=$arg && continue
if [ -n "${arg}" ]; then
test -z "$firstbranch" && firstbranch="${arg}" && continue
test -z "$secondbranch" && secondbranch="${arg}" && continue
else
# add anything else to a passthrough
passthrough="$passthrough $arg"