summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-06-30 00:09:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-06-30 00:09:27 (GMT)
commit4ed54610e5ca8fdc34dcf8729f6416599d1bc39e (patch)
tree3eca1184326848950e0a35938c7ca7032e45a6a1 /setup.c
parent55ac692661f7b850bb0160de18fa9868d24dbe17 (diff)
parentc35ec8c901a2391c4652ab1acdff04c9d67b1543 (diff)
downloadgit-4ed54610e5ca8fdc34dcf8729f6416599d1bc39e.zip
git-4ed54610e5ca8fdc34dcf8729f6416599d1bc39e.tar.gz
git-4ed54610e5ca8fdc34dcf8729f6416599d1bc39e.tar.bz2
Merge branch 'da/git-prefix-everywhere' into next
* da/git-prefix-everywhere: t/t7503-pre-commit-hook.sh: Add GIT_PREFIX tests git-mergetool--lib: Make vimdiff retain the current directory git: Remove handling for GIT_PREFIX setup: Provide GIT_PREFIX to built-ins
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/setup.c b/setup.c
index ce87900..5ea5502 100644
--- a/setup.c
+++ b/setup.c
@@ -710,6 +710,11 @@ const char *setup_git_directory_gently(int *nongit_ok)
const char *prefix;
prefix = setup_git_directory_gently_1(nongit_ok);
+ if (prefix)
+ setenv("GIT_PREFIX", prefix, 1);
+ else
+ setenv("GIT_PREFIX", "", 1);
+
if (startup_info) {
startup_info->have_repository = !nongit_ok || !*nongit_ok;
startup_info->prefix = prefix;