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>
Jonathan Nieder committed
Oct 30, 2009 at 20:43 UTC
dec543e62dbc47be0c06805330a20f7fa9f699a3
2 files changed
+6
-5
git-am.sh
+4
-1
@@ -649,7 +649,10 @@ do
649
[eE]*) git_editor "$dotest/final-commit"
650
action=again ;;
651
[vV]*) action=again
652
- LESS=-S ${PAGER:-less} "$dotest/patch" ;;
652
+ : ${GIT_PAGER=$(git var GIT_PAGER)}
653
+ : ${LESS=-FRSX}
654
+ export LESS
655
+ $GIT_PAGER "$dotest/patch" ;;
656
*) action=again ;;
657
esac
658
done
git-svn.perl
+2
-4
@@ -5171,10 +5171,8 @@ sub git_svn_log_cmd {
5171
5172
# adapted from pager.c
5173
sub config_pager {
5174
- $pager ||= $ENV{GIT_PAGER} || $ENV{PAGER};
5175
- if (!defined $pager) {
5176
- $pager = 'less';
5177
- } elsif (length $pager == 0 || $pager eq 'cat') {
5174
+ chomp(my $pager = command_oneline(qw(var GIT_PAGER)));
5175
+ if ($pager eq 'cat') {
5176
$pager = undef;
5177
}
5178
$ENV{GIT_PAGER_IN_USE} = defined($pager);