Merge branch 'jn/maint-fix-pager'

* jn/maint-fix-pager:
  tests: Fix race condition in t7006-pager
  t7006-pager: if stdout is not a terminal, make a new one
  tests: Add tests for automatic use of pager
  am: Fix launching of pager
  git svn: Fix launching of pager
  git.1: Clarify the behavior of the --paginate option
  Make 'git var GIT_PAGER' always print the configured pager
  Fix 'git var' usage synopsis
This commit is contained in:
Junio C Hamano
2010-03-02 12:44:11 -08:00
10 changed files with 268 additions and 15 deletions

View File

@ -5465,7 +5465,12 @@ sub git_svn_log_cmd {
# adapted from pager.c
sub config_pager {
chomp(my $pager = command_oneline(qw(var GIT_PAGER)));
if (! -t *STDOUT) {
$ENV{GIT_PAGER_IN_USE} = 'false';
$pager = undef;
return;
}
chomp($pager = command_oneline(qw(var GIT_PAGER)));
if ($pager eq 'cat') {
$pager = undef;
}
@ -5473,7 +5478,7 @@ sub config_pager {
}
sub run_pager {
return unless -t *STDOUT && defined $pager;
return unless defined $pager;
pipe my ($rfd, $wfd) or return;
defined(my $pid = fork) or ::fatal "Can't fork: $!";
if (!$pid) {