summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-30 21:07:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-30 21:07:15 (GMT)
commit3736c925580f678f601d670983f7f6cda791d108 (patch)
treed976750cdea8442fa885712354b5c1ab54d45563 /setup.c
parentccf680dea305e0b2bda31a29c37e40e5beb397c8 (diff)
parentb2dfeb7c005b83145e9f61305658f5dac745482a (diff)
downloadgit-3736c925580f678f601d670983f7f6cda791d108.zip
git-3736c925580f678f601d670983f7f6cda791d108.tar.gz
git-3736c925580f678f601d670983f7f6cda791d108.tar.bz2
Merge branch 'bw/recurse-submodules-relative-fix'
A few commands that recently learned the "--recurse-submodule" option misbehaved when started from a subdirectory of the superproject. * bw/recurse-submodules-relative-fix: ls-files: fix bug when recursing with relative pathspec ls-files: fix typo in variable name grep: fix bug when recursing with relative pathspec setup: allow for prefix to be passed to git commands grep: fix help text typo
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index 5c7946d..0309c27 100644
--- a/setup.c
+++ b/setup.c
@@ -987,7 +987,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
{
static struct strbuf cwd = STRBUF_INIT;
struct strbuf dir = STRBUF_INIT, gitdir = STRBUF_INIT;
- const char *prefix;
+ const char *prefix, *env_prefix;
/*
* We may have read an incomplete configuration before
@@ -1045,6 +1045,10 @@ const char *setup_git_directory_gently(int *nongit_ok)
die("BUG: unhandled setup_git_directory_1() result");
}
+ env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT);
+ if (env_prefix)
+ prefix = env_prefix;
+
if (prefix)
setenv(GIT_PREFIX_ENVIRONMENT, prefix, 1);
else