Code

bundle, fast-import: detect write failure
[git.git] / git-sh-setup.sh
index b366761b976a136144c7483de5c883a084996816..aae14090bd884920c7b5cb7530db66719df98ddd 100755 (executable)
@@ -18,7 +18,8 @@ die() {
 
 if test -n "$OPTIONS_SPEC"; then
        usage() {
-               exec "$0" -h
+               "$0" -h
+               exit 1
        }
 
        parseopt_extra=
@@ -124,13 +125,8 @@ get_author_ident_from_commit () {
 
 # Make sure we are in a valid repository of a vintage we understand,
 # if we require to be in a git repository.
-if test -n "$NONGIT_OK"
+if test -z "$NONGIT_OK"
 then
-       if git rev-parse --git-dir >/dev/null 2>&1
-       then
-               : ${GIT_DIR=.git}
-       fi
-else
        if [ -z "$SUBDIRECTORY_OK" ]
        then
                : ${GIT_DIR=.git}