diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-03-30 14:07:15 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-30 14:07:15 -0700 |
commit | 3736c925580f678f601d670983f7f6cda791d108 (patch) | |
tree | d976750cdea8442fa885712354b5c1ab54d45563 /setup.c | |
parent | ccf680dea305e0b2bda31a29c37e40e5beb397c8 (diff) | |
parent | b2dfeb7c005b83145e9f61305658f5dac745482a (diff) | |
download | git-3736c925580f678f601d670983f7f6cda791d108.tar.gz |
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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |