From efe660b3b1dcd228e0cc02f8f7bc2fcfbfadce72 Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Thu, 27 Mar 2025 11:42:58 +0100 Subject: [PATCH] fix: remove duplicate pager call --- files/git/.local/bin/git-pager | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/files/git/.local/bin/git-pager b/files/git/.local/bin/git-pager index a7aa261..4481785 100755 --- a/files/git/.local/bin/git-pager +++ b/files/git/.local/bin/git-pager @@ -1,30 +1,35 @@ #!/bin/sh -## SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. +## SPDX-FileCopyrightText: 2023 - 2025 Benjamin Grande M. S. ## ## SPDX-License-Identifier: AGPL-3.0-or-later set -eu if command -v delta >/dev/null; then - exec delta "${@}" + exec delta -- "${@}" else : "${DIFF_HIGHLIGHT_SOURCE:=/usr/share/doc/git/contrib/diff-highlight}" : "${DIFF_HIGHLIGHT_EXEC:=/usr/share/git-core/contrib/diff-highlight}" + git_less(){ + exec less -RS -- "${@}" + } + ## Debian. if command -v perl >/dev/null && test -f "${DIFF_HIGHLIGHT_SOURCE}/DiffHighlight.pm" && test -f "${DIFF_HIGHLIGHT_SOURCE}/diff-highlight.perl" then 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. elif command -v perl >/dev/null && test -f "${DIFF_HIGHLIGHT_EXEC}" then - exec "${DIFF_HIGHLIGHT_EXEC}" | less -RS + exec "${DIFF_HIGHLIGHT_EXEC}" | git_less + exit fi - exec less -RS "${@}" + git_less "${@}" fi