aboutsummaryrefslogtreecommitdiff
path: root/git-sh-setup.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-08 00:36:02 -0800
committerJunio C Hamano <gitster@pobox.com>2010-03-08 00:36:02 -0800
commitbd08ecc487f3b515196cc4096094799a02de6ae3 (patch)
tree920218f73799f6dffcbd1b3bb0d4e878fa449c29 /git-sh-setup.sh
parent030bc0aa8b012170b69f40f95b152a1080447301 (diff)
parent5ce9086ddfe6931ef34fcd99778c9235e2ee1839 (diff)
downloadgit-bd08ecc487f3b515196cc4096094799a02de6ae3.tar.gz
git-bd08ecc487f3b515196cc4096094799a02de6ae3.tar.xz
Merge branch 'gb/maint-submodule-env' into maint
* 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')
-rwxr-xr-xgit-sh-setup.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 7a095665d..613167086 100755
--- 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"