Skip to content

Commit 7d665f3

Browse files
wyandgitster
authored andcommitted
git-sh-setup.sh: use dashdash with basename call
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>
1 parent 7fa1365 commit 7d665f3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

git-sh-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ if test -n "$OPTIONS_SPEC"; then
8181
echo exit $?
8282
)"
8383
else
84-
dashless=$(basename "$0" | sed -e 's/-/ /')
84+
dashless=$(basename -- "$0" | sed -e 's/-/ /')
8585
usage() {
8686
die "usage: $dashless $USAGE"
8787
}

0 commit comments

Comments
 (0)