Skip to content

Commit 53f3478

Browse files
committed
Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn: git-svn: workaround for a bug in svn serf backend
2 parents 36ec9e2 + 2394e94 commit 53f3478

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

perl/Git/SVN/Editor.pm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,12 @@ sub C {
304304
my ($self, $m, $deletions) = @_;
305305
my ($dir, $file) = split_path($m->{file_b});
306306
my $pbat = $self->ensure_path($dir, $deletions);
307+
# workaround for a bug in svn serf backend (v1.8.5 and below):
308+
# store third argument to ->add_file() in a local variable, to make it
309+
# have the same lifetime as $fbat
310+
my $upa = $self->url_path($m->{file_a});
307311
my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
308-
$self->url_path($m->{file_a}), $self->{r});
312+
$upa, $self->{r});
309313
print "\tC\t$m->{file_a} => $m->{file_b}\n" unless $::_q;
310314
$self->chg_file($fbat, $m);
311315
$self->close_file($fbat,undef,$self->{pool});
@@ -323,8 +327,10 @@ sub R {
323327
my ($self, $m, $deletions) = @_;
324328
my ($dir, $file) = split_path($m->{file_b});
325329
my $pbat = $self->ensure_path($dir, $deletions);
330+
# workaround for a bug in svn serf backend, see comment in C() above
331+
my $upa = $self->url_path($m->{file_a});
326332
my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
327-
$self->url_path($m->{file_a}), $self->{r});
333+
$upa, $self->{r});
328334
print "\tR\t$m->{file_a} => $m->{file_b}\n" unless $::_q;
329335
$self->apply_autoprops($file, $fbat);
330336
$self->chg_file($fbat, $m);

0 commit comments

Comments
 (0)