summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 233054d)
raw | patch | inline | side by side (parent: 233054d)
author | Christian Hammerl <info@christian-hammerl.de> | |
Mon, 20 Feb 2012 12:17:53 +0000 (13:17 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 21 Feb 2012 20:38:07 +0000 (12:38 -0800) |
If the argument for `__git_ps1` begins with a dash, `printf` tries to
interpret it as an option which results in an error message.
The problem is solved by adding '--' before the argument to tell
`printf` to not interpret the following argument as an option.
Adding '--' directly to the argument does not help because the argument
is enclosed by double quotes.
Signed-off-by: Christian Hammerl <info@christian-hammerl.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
interpret it as an option which results in an error message.
The problem is solved by adding '--' before the argument to tell
`printf` to not interpret the following argument as an option.
Adding '--' directly to the argument does not help because the argument
is enclosed by double quotes.
Signed-off-by: Christian Hammerl <info@christian-hammerl.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash | patch | blob | history |
index 91c7acbbb48516e34d2bfc34617e2efd75aaf2b1..61ff1521b625111a839941325a232c73ac01cda2 100755 (executable)
fi
local f="$w$i$s$u"
- printf "${1:- (%s)}" "$c${b##refs/heads/}${f:+ $f}$r$p"
+ printf -- "${1:- (%s)}" "$c${b##refs/heads/}${f:+ $f}$r$p"
fi
}