diff mbox series

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

Message ID patch-v2-4.7-46c018aa860-20210906T070201Z-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series remove dead & undocumented shell code | expand

Commit Message

Ævar Arnfjörð Bjarmason Sept. 6, 2021, 7:05 a.m. UTC
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@gmail.com>
---
 git-sh-setup.sh  | 7 -------
 git-submodule.sh | 2 +-
 2 files changed, 1 insertion(+), 8 deletions(-)
diff mbox series

Patch

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
 }