diff mbox series

[3/9] git-sh-setup: remove unused git_pager() function

Message ID patch-3.9-73e540896fc-20210902T155758Z-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series remove dead shell code | expand

Commit Message

Ævar Arnfjörð Bjarmason Sept. 2, 2021, 4:01 p.m. UTC
Remove the git_editor() function last referenced by non-test code code
in 49eb8d39c78 (Remove contrib/examples/*, 2018-03-25).

We can also remove the test for this added in 995bc22d7f8 (pager: move
pager-specific setup into the build, 2016-08-04), the test that
actually matters is the one added in e54c1f2d253 (pager: set LV=-c
alongside LESS=FRSX, 2014-01-06) just above the removed test.

I.e. we don't care if the "LESS" and "LV" variables are set by
git-sh-setup anymore, no built-in uses them, we do care that pager.c
sets them, which we still test for.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 git-sh-setup.sh  | 16 ----------------
 t/t7006-pager.sh | 13 -------------
 2 files changed, 29 deletions(-)

Comments

Philippe Blain Sept. 2, 2021, 4:34 p.m. UTC | #1
Hi Ævar,

Le 2021-09-02 à 12:01, Ævar Arnfjörð Bjarmason a écrit :
> Remove the git_editor() function last referenced by non-test code code
> in 49eb8d39c78 (Remove contrib/examples/*, 2018-03-25).
> 

s/code code/code/

Thanks,

Philippe.
Andrei Rybak Sept. 2, 2021, 9:13 p.m. UTC | #2
On 02/09/2021 18:34, Philippe Blain wrote:
> Hi Ævar,
> 
> Le 2021-09-02 à 12:01, Ævar Arnfjörð Bjarmason a écrit :
>> Remove the git_editor() function last referenced by non-test code code

Also s/git_editor/git_pager/

>> in 49eb8d39c78 (Remove contrib/examples/*, 2018-03-25).
>>
> 
> s/code code/code/
> 
> Thanks,
> 
> Philippe.
diff mbox series

Patch

diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index cfedda79471..d4e8225affa 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -106,22 +106,6 @@  $LONG_USAGE")"
 	esac
 fi
 
-git_pager() {
-	if test -t 1
-	then
-		GIT_PAGER=$(git var GIT_PAGER)
-	else
-		GIT_PAGER=cat
-	fi
-	for vardef in @@PAGER_ENV@@
-	do
-		var=${vardef%%=*}
-		eval ": \"\${$vardef}\" && export $var"
-	done
-
-	eval "$GIT_PAGER" '"$@"'
-}
-
 sane_grep () {
 	GREP_OPTIONS= LC_ALL=C grep @@SANE_TEXT_GREP@@ "$@"
 }
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 0e7cf75435e..08f712a4497 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -49,19 +49,6 @@  test_expect_success TTY 'LESS and LV envvars are set for pagination' '
 	grep ^LV= pager-env.out
 '
 
-test_expect_success !MINGW,TTY 'LESS and LV envvars set by git-sh-setup' '
-	(
-		sane_unset LESS LV &&
-		PAGER="env >pager-env.out; wc" &&
-		export PAGER &&
-		PATH="$(git --exec-path):$PATH" &&
-		export PATH &&
-		test_terminal sh -c ". git-sh-setup && git_pager"
-	) &&
-	grep ^LESS= pager-env.out &&
-	grep ^LV= pager-env.out
-'
-
 test_expect_success TTY 'some commands do not use a pager' '
 	rm -f paginated.out &&
 	test_terminal git rev-list HEAD &&