]> rtime.felk.cvut.cz Git - git.git/blobdiff - git-sh-setup.sh
submodule: Fix documentation of update subcommand
[git.git] / git-sh-setup.sh
index fffa3c72d75961159888fd156614aa6679f3638c..c42c6e6365090e22ec7892baa51b919f2898e956 100644 (file)
@@ -72,6 +72,8 @@ if test -n "$OPTIONS_SPEC"; then
        parseopt_extra=
        [ -n "$OPTIONS_KEEPDASHDASH" ] &&
                parseopt_extra="--keep-dashdash"
+       [ -n "$OPTIONS_STUCKLONG" ] &&
+               parseopt_extra="$parseopt_extra --stuck-long"
 
        eval "$(
                echo "$OPTIONS_SPEC" |
@@ -79,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"
        }
@@ -158,7 +160,7 @@ git_pager() {
        else
                GIT_PAGER=cat
        fi
-       : ${LESS=-FRSX}
+       : ${LESS=-FRX}
        : ${LV=-c}
        export LESS LV
 
@@ -328,8 +330,7 @@ esac
 
 # 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
@@ -344,6 +345,11 @@ then
                exit 1
        }
        : ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
+}
+
+if test -z "$NONGIT_OK"
+then
+       git_dir_init
 fi
 
 peel_committish () {