summaryrefslogtreecommitdiff
path: root/git-sh-setup.sh
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2014-10-11 08:39:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-10-15 21:12:20 (GMT)
commit1c7e2d23e4f22f1599570d9c5d0cc2f4156b5b74 (patch)
tree1ab1b3b141b9877cd20978a13ab0df345547cf66 /git-sh-setup.sh
parent9c66cd3bd0a70b2cf56589a4df2cf63814270635 (diff)
downloadgit-1c7e2d23e4f22f1599570d9c5d0cc2f4156b5b74.zip
git-1c7e2d23e4f22f1599570d9c5d0cc2f4156b5b74.tar.gz
git-1c7e2d23e4f22f1599570d9c5d0cc2f4156b5b74.tar.bz2
git-sh-setup: move GIT_DIR initialization into a function
Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 5f28b32..3eb1b67 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 () {