mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
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:
parent
3c7d4e67f4
commit
db0f610bc1
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue