summaryrefslogtreecommitdiff
path: root/perl/Git/SVN
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-02-26 22:03:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-02-26 22:03:57 (GMT)
commit28ed7b02dd726bcc5c8d3fc316c965a3c0f05c04 (patch)
tree89b62e09fe810cacfa218c4ca3b3bee2d4a90cb2 /perl/Git/SVN
parent47092c10671da906ae626634dc83beb29ce76a9d (diff)
parente426311befe429ad39b47927cd12153b7aa99542 (diff)
downloadgit-28ed7b02dd726bcc5c8d3fc316c965a3c0f05c04.zip
git-28ed7b02dd726bcc5c8d3fc316c965a3c0f05c04.tar.gz
git-28ed7b02dd726bcc5c8d3fc316c965a3c0f05c04.tar.bz2
Merge branch 'svn-maint-fixes' into svn-fixes
* svn-maint-fixes: Git::SVN::*: avoid premature FileHandle closure git-svn: fix localtime=true on non-glibc environments
Diffstat (limited to 'perl/Git/SVN')
-rw-r--r--perl/Git/SVN/Fetcher.pm8
-rw-r--r--perl/Git/SVN/Ra.pm3
2 files changed, 11 insertions, 0 deletions
diff --git a/perl/Git/SVN/Fetcher.pm b/perl/Git/SVN/Fetcher.pm
index 6b9c6e0..d8c21ad 100644
--- a/perl/Git/SVN/Fetcher.pm
+++ b/perl/Git/SVN/Fetcher.pm
@@ -321,6 +321,14 @@ sub apply_textdelta {
# (but $base does not,) so dup() it for reading in close_file
open my $dup, '<&', $fh or croak $!;
my $base = $::_repository->temp_acquire("git_blob_${$}_$suffix");
+ # close_file may call temp_acquire on 'svn_hash', but because of the
+ # call chain, if the temp_acquire call from close_file ends up being the
+ # call that first creates the 'svn_hash' temp file, then the FileHandle
+ # that's created as a result will end up in an SVN::Pool that we clear
+ # in SVN::Ra::gs_fetch_loop_common. Avoid that by making sure the
+ # 'svn_hash' FileHandle is already created before close_file is called.
+ my $tmp_fh = $::_repository->temp_acquire('svn_hash');
+ $::_repository->temp_release($tmp_fh, 1);
if ($fb->{blob}) {
my ($base_is_link, $size);
diff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm
index cf36b9d..4a499fc 100644
--- a/perl/Git/SVN/Ra.pm
+++ b/perl/Git/SVN/Ra.pm
@@ -394,6 +394,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 {