From db0f610bc14f7067fa9ae09ac64f623ea071efba Mon Sep 17 00:00:00 2001 From: Guillaume Seren Date: Tue, 14 Oct 2014 16:05:52 +0200 Subject: [PATCH] Fix #267, git-missing did not catch branch name. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- bin/git-missing | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/git-missing b/bin/git-missing index 7a7c8b5..3a90410 100755 --- a/bin/git-missing +++ b/bin/git-missing @@ -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"