summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl27
1 files changed, 19 insertions, 8 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 265852f459..b7c03b641c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -36,11 +36,13 @@ $ENV{TZ} = 'UTC';
$| = 1; # unbuffer STDOUT
sub fatal (@) { print STDERR "@_\n"; exit 1 }
-require SVN::Core; # use()-ing this causes segfaults for me... *shrug*
-require SVN::Ra;
-require SVN::Delta;
-if ($SVN::Core::VERSION lt '1.1.0') {
- fatal "Need SVN::Core 1.1.0 or better (got $SVN::Core::VERSION)";
+sub _req_svn {
+ require SVN::Core; # use()-ing this causes segfaults for me... *shrug*
+ require SVN::Ra;
+ require SVN::Delta;
+ if ($SVN::Core::VERSION lt '1.1.0') {
+ fatal "Need SVN::Core 1.1.0 or better (got $SVN::Core::VERSION)";
+ }
}
my $can_compress = eval { require Compress::Zlib; 1};
push @Git::SVN::Ra::ISA, 'SVN::Ra';
@@ -730,6 +732,8 @@ sub cmd_branch {
$src=~s/^http:/https:/;
}
+ ::_req_svn();
+
my $ctx = SVN::Client->new(
auth => Git::SVN::Ra::_auth_providers(),
log_msg => sub {
@@ -3273,7 +3277,7 @@ sub find_extra_svn_parents {
"$new_parents[$i]..$new_parents[$j]",
);
if ( !$revs ) {
- undef($new_parents[$i]);
+ undef($new_parents[$j]);
}
}
}
@@ -4859,6 +4863,8 @@ sub new {
$url =~ s!/+$!!;
return $RA if ($RA && $RA->{url} eq $url);
+ ::_req_svn();
+
SVN::_Core::svn_config_ensure($config_dir, undef);
my ($baton, $callbacks) = SVN::Core::auth_open_helper(_auth_providers);
my $config = SVN::Core::config_get_config($config_dir);
@@ -5459,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;
}
@@ -5467,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) {