[PATCH v2 4/7] git-sh-setup: clear_local_git_env() function to git-submodule.sh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since 14111fc4927 (git: submodule honor -c credential.* from command
line, 2016-02-29) the clear_local_git_env() function has only been
used in the sanitize_submodule_env() function, let's inline its
one-line functionality there.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
---
 git-sh-setup.sh  | 7 -------
 git-submodule.sh | 2 +-
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 3fc8830cb36..b3a97d6455a 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -290,13 +290,6 @@ get_author_ident_from_commit () {
 	parse_ident_from_commit author AUTHOR
 }
 
-# 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)
-}
-
 # Generate a virtual base file for a two-file merge. Uses git apply to
 # remove lines from $1 that are not in $2, leaving only common lines.
 create_virtual_base() {
diff --git a/git-submodule.sh b/git-submodule.sh
index aeb96c58243..c9dca58fdaa 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -69,7 +69,7 @@ isnumber()
 sanitize_submodule_env()
 {
 	save_config=$GIT_CONFIG_PARAMETERS
-	clear_local_git_env
+	unset $(git rev-parse --local-env-vars)
 	GIT_CONFIG_PARAMETERS=$save_config
 	export GIT_CONFIG_PARAMETERS
 }
-- 
2.33.0.821.gfd4106eadbd




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux