fix: remove duplicate pager call

This commit is contained in:
Ben Grande 2025-03-27 11:42:58 +01:00
parent 45a0acb222
commit efe660b3b1
No known key found for this signature in database
GPG Key ID: 00C64E14F51F9E56

View File

@ -1,30 +1,35 @@
#!/bin/sh #!/bin/sh
## SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com> ## SPDX-FileCopyrightText: 2023 - 2025 Benjamin Grande M. S. <ben.grande.b@gmail.com>
## ##
## SPDX-License-Identifier: AGPL-3.0-or-later ## SPDX-License-Identifier: AGPL-3.0-or-later
set -eu set -eu
if command -v delta >/dev/null; then if command -v delta >/dev/null; then
exec delta "${@}" exec delta -- "${@}"
else else
: "${DIFF_HIGHLIGHT_SOURCE:=/usr/share/doc/git/contrib/diff-highlight}" : "${DIFF_HIGHLIGHT_SOURCE:=/usr/share/doc/git/contrib/diff-highlight}"
: "${DIFF_HIGHLIGHT_EXEC:=/usr/share/git-core/contrib/diff-highlight}" : "${DIFF_HIGHLIGHT_EXEC:=/usr/share/git-core/contrib/diff-highlight}"
git_less(){
exec less -RS -- "${@}"
}
## Debian. ## Debian.
if command -v perl >/dev/null && if command -v perl >/dev/null &&
test -f "${DIFF_HIGHLIGHT_SOURCE}/DiffHighlight.pm" && test -f "${DIFF_HIGHLIGHT_SOURCE}/DiffHighlight.pm" &&
test -f "${DIFF_HIGHLIGHT_SOURCE}/diff-highlight.perl" test -f "${DIFF_HIGHLIGHT_SOURCE}/diff-highlight.perl"
then then
exec perl -I "${DIFF_HIGHLIGHT_SOURCE}" -MDiffHighlight -- \ exec perl -I "${DIFF_HIGHLIGHT_SOURCE}" -MDiffHighlight -- \
"${DIFF_HIGHLIGHT_SOURCE}/diff-highlight.perl" | less -RS "${DIFF_HIGHLIGHT_SOURCE}/diff-highlight.perl" | git_less
exit
## Fedora. ## Fedora.
elif command -v perl >/dev/null && test -f "${DIFF_HIGHLIGHT_EXEC}" elif command -v perl >/dev/null && test -f "${DIFF_HIGHLIGHT_EXEC}"
then then
exec "${DIFF_HIGHLIGHT_EXEC}" | less -RS exec "${DIFF_HIGHLIGHT_EXEC}" | git_less
exit
fi fi
exec less -RS "${@}" git_less "${@}"
fi fi