git-sh-setup.sh: use dashdash with basename call
authorDan Wyand <danwyand@gmail.com>
Mon, 24 Nov 2014 23:03:31 +0000 (18:03 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 25 Nov 2014 18:06:08 +0000 (10:06 -0800)
Calling basename on a argument that starts with a dash, like a login
shell, will result in an error. Add '--' before the argument so that
the argument is interpreted properly.

Signed-off-by: Dan Wyand <danwyand@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-sh-setup.sh
index 9447980330ce7892757f9b11fa45cfeb3e6fcb34..5cdae338b80ce6bc532aa28973a3d62f2ec159aa 100644 (file)
@@ -81,7 +81,7 @@ if test -n "$OPTIONS_SPEC"; then
                echo exit $?
        )"
 else
-       dashless=$(basename "$0" | sed -e 's/-/ /')
+       dashless=$(basename -- "$0" | sed -e 's/-/ /')
        usage() {
                die "usage: $dashless $USAGE"
        }