summaryrefslogtreecommitdiff
path: root/git-sh-setup.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-10-21 13:28:37 -0700
committerJunio C Hamano <gitster@pobox.com>2014-10-21 13:28:37 -0700
commite96e98b3399ae4c638466f84068fe94d4712c5a3 (patch)
tree55cee4b82db5239c5f1b2070509c261b378f55f3 /git-sh-setup.sh
parent02f4db83bd979fe33f18006fa612d7d5ab1d2470 (diff)
parent4fb4b02d98310f4f859f7d52f57f36d49198be5c (diff)
downloadgit-e96e98b3399ae4c638466f84068fe94d4712c5a3.tar.gz
Merge branch 'da/mergetool-tool-help'
Allow "git mergetool --help" to run outside a Git repository. * da/mergetool-tool-help: difftool: don't assume that default sh is sane mergetool: don't require a work tree for --tool-help git-sh-setup: move GIT_DIR initialization into a function mergetool: use more conservative temporary filenames test-lib-functions: adjust style to match CodingGuidelines t7610-mergetool: prefer test_config over git config
Diffstat (limited to 'git-sh-setup.sh')
-rw-r--r--git-sh-setup.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 9447980330..d968760139 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -330,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
@@ -346,6 +345,11 @@ then
exit 1
}
: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
+}
+
+if test -z "$NONGIT_OK"
+then
+ git_dir_init
fi
peel_committish () {