git-submodule.sh: remove unused sanitize_submodule_env()

The sanitize_submodule_env() function was last used before b3c5f5cb048 (submodule: move core cmd_update() logic to C, 2022-03-15), let's remove it. This also allows us to remove clear_local_git_env() from git-sh-setup.sh. That function hasn't been documented in Documentation/git-sh-setup.sh, and since 14111fc4927 (git: submodule honor -c credential.* from command line, 2016-02-29) it had only been used in the sanitize_submodule_env() function being removed here. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Jun 28, 2022 at 12:05 UTC 85775255f18e0a6a6b2e65394bc18ec440dba99d
2 files changed -18
git-sh-setup.sh
-7
@@ -285,13 +285,6 @@ get_author_ident_from_commit () {
285 parse_ident_from_commit author AUTHOR
286 }
287
288 -# Clear repo-local GIT_* environment variables. Useful when switching to
289 -# another repository (e.g. when entering a submodule). See also the env
290 -# list in git_connect()
291 -clear_local_git_env() {
292 - unset $(git rev-parse --local-env-vars)
293 -}
294 -
288 # Generate a virtual base file for a two-file merge. Uses git apply to
289 # remove lines from $1 that are not in $2, leaving only common lines.
290 create_virtual_base() {
git-submodule.sh
-11
@@ -56,17 +56,6 @@ isnumber()
56 n=$(($1 + 0)) 2>/dev/null && test "$n" = "$1"
57 }
58
59 -# Sanitize the local git environment for use within a submodule. We
60 -# can't simply use clear_local_git_env since we want to preserve some
61 -# of the settings from GIT_CONFIG_PARAMETERS.
62 -sanitize_submodule_env()
63 -{
64 - save_config=$GIT_CONFIG_PARAMETERS
65 - clear_local_git_env
66 - GIT_CONFIG_PARAMETERS=$save_config
67 - export GIT_CONFIG_PARAMETERS
68 -}
69 -
59 #
60 # Add a new submodule to the working tree, .gitmodules and the index
61 #