diff mbox series

[1/5] parse-remote: remove unused GIT_DIR variable

Message ID 20201111151754.31527-2-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/5] parse-remote: remove unused GIT_DIR variable | expand

Commit Message

Ævar Arnfjörð Bjarmason Nov. 11, 2020, 3:17 p.m. UTC
This variable was last used in code removed way back in
45781adb9a ("get_remote_url(): use the same data source as ls-remote
to get remote urls", 2011-03-01).

Since it's only used in git-submodule.sh it could have been the case
that the code there relied on us setting $GIT_DIR, but that's not the
case. The only use of $GIT_DIR in git-submodule.sh involves a $GIT_DIR
variable that the code there sets by itself.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 git-parse-remote.sh | 4 ----
 1 file changed, 4 deletions(-)
diff mbox series

Patch

diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index d3c39980f3..6b743cda17 100644
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -2,10 +2,6 @@ 
 # upstream branch that should be pulled by "git pull" from the current
 # branch.
 
-# git-ls-remote could be called from outside a git managed repository;
-# this would fail in that case and would issue an error message.
-GIT_DIR=$(git rev-parse -q --git-dir) || :;
-
 get_default_remote () {
 	curr_branch=$(git symbolic-ref -q HEAD)
 	curr_branch="${curr_branch#refs/heads/}"