summaryrefslogtreecommitdiff
path: root/perl
diff options
context:
space:
mode:
authorLibravatar Eric Wong <normalperson@yhbt.net>2014-10-31 10:34:03 +0000
committerLibravatar Eric Wong <normalperson@yhbt.net>2014-10-31 10:34:54 +0000
commit7ffa35b0479dac547659f06b8a6ea7d31c57cc05 (patch)
tree2b855ab3e122f13da3be989379012d4d0205e0d2 /perl
parentgit-svn: add space after "W:" prefix in warning (diff)
downloadtgif-7ffa35b0479dac547659f06b8a6ea7d31c57cc05.tar.xz
git-svn: use SVN::Ra::get_dir2 when possible
This avoids the following failure with normal "get_dir" on newer versions of SVN (tested with SVN 1.8.8-1ubuntu3.1): Incorrect parameters given: Could not convert '%ld' into a number get_dir2 also has the potential to be more efficient by requesting less data. ref: <1414636504.45506.YahooMailBasic@web172304.mail.ir2.yahoo.com> ref: <1414722617.89476.YahooMailBasic@web172305.mail.ir2.yahoo.com> Signed-off-by: Eric Wong <normalperson@yhbt.net> Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Diffstat (limited to 'perl')
-rw-r--r--perl/Git/SVN/Ra.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm
index 75cdac90cf..622535e217 100644
--- a/perl/Git/SVN/Ra.pm
+++ b/perl/Git/SVN/Ra.pm
@@ -175,7 +175,17 @@ sub get_dir {
}
}
my $pool = SVN::Pool->new;
- my ($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool);
+ my ($d, undef, $props);
+
+ if (::compare_svn_version('1.4.0') >= 0) {
+ # n.b. in addition to being potentially more efficient,
+ # this works around what appears to be a bug in some
+ # SVN 1.8 versions
+ my $kind = 1; # SVN_DIRENT_KIND
+ ($d, undef, $props) = $self->get_dir2($dir, $r, $kind, $pool);
+ } else {
+ ($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool);
+ }
my %dirents = map { $_ => { kind => $d->{$_}->kind } } keys %$d;
$pool->clear;
if ($r != $cache->{r}) {