connect: improve check for plink to reduce false positives
[gitweb.git] / perl / Git / SVN / Ra.pm
index 75cdac90cfbaafdfcda523e598e45499bc1ae6d1..32e2f19ea41b2dfed735cf1fa5e1fa49f3fed915 100644 (file)
@@ -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}) {
@@ -381,6 +391,9 @@ sub longest_common_path {
 sub gs_fetch_loop_common {
        my ($self, $base, $head, $gsv, $globs) = @_;
        return if ($base > $head);
+       # Make sure the cat_blob open2 FileHandle is created before calling
+       # SVN::Pool::new_default so that it does not incorrectly end up in the pool.
+       $::_repository->_open_cat_blob_if_needed;
        my $gpool = SVN::Pool->new_default;
        my $ra_url = $self->url;
        my $reload_ra = sub {