Merge branch 'dw/shell-basename-dashdash-before-stripping-leading-dash-from-login'
authorJunio C Hamano <gitster@pobox.com>
Mon, 22 Dec 2014 20:26:48 +0000 (12:26 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Dec 2014 20:26:48 +0000 (12:26 -0800)
* dw/shell-basename-dashdash-before-stripping-leading-dash-from-login:
git-sh-setup.sh: use dashdash with basename call

1  2 
git-sh-setup.sh
diff --combined git-sh-setup.sh
index d968760139b0e7b9219a1602a2e646a3ed398136,5cdae338b80ce6bc532aa28973a3d62f2ec159aa..c42c6e6365090e22ec7892baa51b919f2898e956
@@@ -81,7 -81,7 +81,7 @@@ if test -n "$OPTIONS_SPEC"; the
                echo exit $?
        )"
  else
-       dashless=$(basename "$0" | sed -e 's/-/ /')
+       dashless=$(basename -- "$0" | sed -e 's/-/ /')
        usage() {
                die "usage: $dashless $USAGE"
        }
@@@ -330,7 -330,8 +330,7 @@@ esa
  
  # Make sure we are in a valid repository of a vintage we understand,
  # if we require to be in a git repository.
 -if test -z "$NONGIT_OK"
 -then
 +git_dir_init () {
        GIT_DIR=$(git rev-parse --git-dir) || exit
        if [ -z "$SUBDIRECTORY_OK" ]
        then
                exit 1
        }
        : ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
 +}
 +
 +if test -z "$NONGIT_OK"
 +then
 +      git_dir_init
  fi
  
  peel_committish () {