summaryrefslogtreecommitdiff
path: root/git-sh-setup.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-07 12:47:17 -0800
committerJunio C Hamano <gitster@pobox.com>2010-03-07 12:47:17 -0800
commit9317dc4f051452a0e0f7a62a5531b16adf36b553 (patch)
tree0ef09fc4b06b1721faa516a302e18a8c5baf887a /git-sh-setup.sh
parent27a23031056fbd540f7c34d78a3f097a3a7c211c (diff)
parent5ce9086ddfe6931ef34fcd99778c9235e2ee1839 (diff)
downloadgit-9317dc4f051452a0e0f7a62a5531b16adf36b553.tar.gz
Merge branch 'gb/maint-submodule-env'
* gb/maint-submodule-env: is_submodule_modified(): clear environment properly submodules: ensure clean environment when operating in a submodule shell setup: clear_local_git_env() function rev-parse: --local-env-vars option Refactor list of of repo-local env vars
Diffstat (limited to 'git-sh-setup.sh')
-rw-r--r--git-sh-setup.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 7a095665d7..6131670860 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -172,6 +172,13 @@ get_author_ident_from_commit () {
LANG=C LC_ALL=C sed -ne "$pick_author_script"
}
+# Clear repo-local GIT_* environment variables. Useful when switching to
+# another repository (e.g. when entering a submodule). See also the env
+# list in git_connect()
+clear_local_git_env() {
+ unset $(git rev-parse --local-env-vars)
+}
+
# 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"