am -i, git-svn: use "git var GIT_PAGER"

Use the new "git var GIT_PAGER" command to ask what pager to use.

Without this change, the core.pager configuration is ignored by
these commands.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jonathan Nieder 2009-10-30 20:43:19 -05:00 committed by Junio C Hamano
parent b4479f0747
commit dec543e62d
2 changed files with 6 additions and 5 deletions

View File

@ -649,7 +649,10 @@ do
[eE]*) git_editor "$dotest/final-commit" [eE]*) git_editor "$dotest/final-commit"
action=again ;; action=again ;;
[vV]*) action=again [vV]*) action=again
LESS=-S ${PAGER:-less} "$dotest/patch" ;; : ${GIT_PAGER=$(git var GIT_PAGER)}
: ${LESS=-FRSX}
export LESS
$GIT_PAGER "$dotest/patch" ;;
*) action=again ;; *) action=again ;;
esac esac
done done

View File

@ -5171,10 +5171,8 @@ sub git_svn_log_cmd {
# adapted from pager.c # adapted from pager.c
sub config_pager { sub config_pager {
$pager ||= $ENV{GIT_PAGER} || $ENV{PAGER}; chomp(my $pager = command_oneline(qw(var GIT_PAGER)));
if (!defined $pager) { if ($pager eq 'cat') {
$pager = 'less';
} elsif (length $pager == 0 || $pager eq 'cat') {
$pager = undef; $pager = undef;
} }
$ENV{GIT_PAGER_IN_USE} = defined($pager); $ENV{GIT_PAGER_IN_USE} = defined($pager);