Skip to content

Commit 7ffa35b

Browse files
author
Eric Wong
committed
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: <[email protected]> ref: <[email protected]> Signed-off-by: Eric Wong <[email protected]> Cc: Hin-Tak Leung <[email protected]>
1 parent da0bc94 commit 7ffa35b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

perl/Git/SVN/Ra.pm

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,17 @@ sub get_dir {
175175
}
176176
}
177177
my $pool = SVN::Pool->new;
178-
my ($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool);
178+
my ($d, undef, $props);
179+
180+
if (::compare_svn_version('1.4.0') >= 0) {
181+
# n.b. in addition to being potentially more efficient,
182+
# this works around what appears to be a bug in some
183+
# SVN 1.8 versions
184+
my $kind = 1; # SVN_DIRENT_KIND
185+
($d, undef, $props) = $self->get_dir2($dir, $r, $kind, $pool);
186+
} else {
187+
($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool);
188+
}
179189
my %dirents = map { $_ => { kind => $d->{$_}->kind } } keys %$d;
180190
$pool->clear;
181191
if ($r != $cache->{r}) {

0 commit comments

Comments
 (0)