summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorAlec Berryman <alec@thened.net>2008-09-14 17:14:16 -0400
committerJunio C Hamano <gitster@pobox.com>2008-09-18 19:21:40 -0700
commitad0a82bae0e08819520ab7442dd3a7eb7532bbe6 (patch)
tree73b185c251a959c37b1dfbd1f424baa161906147 /git-svn.perl
parentdd9da51fe261f723d206fdd5e4874c25937d1b87 (diff)
downloadgit-ad0a82bae0e08819520ab7442dd3a7eb7532bbe6.tar.gz
git-svn: Always create a new RA when calling do_switch for svn://
Not doing so caused the "Malformed network data" error when a directoy was deleted and replaced with a copy from an older version. Signed-off-by: Alec Berryman <alec@thened.net> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl25
1 files changed, 12 insertions, 13 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 237895c236..4e9d755066 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3969,20 +3969,19 @@ sub gs_do_switch {
my $old_url = $full_url;
$full_url .= '/' . escape_uri_only($path) if length $path;
my ($ra, $reparented);
- if ($old_url ne $full_url) {
- if ($old_url !~ m#^svn(\+ssh)?://#) {
- SVN::_Ra::svn_ra_reparent($self->{session}, $full_url,
- $pool);
- $self->{url} = $full_url;
- $reparented = 1;
- } else {
- $_[0] = undef;
- $self = undef;
- $RA = undef;
- $ra = Git::SVN::Ra->new($full_url);
- $ra_invalid = 1;
- }
+
+ if ($old_url =~ m#^svn(\+ssh)?://#) {
+ $_[0] = undef;
+ $self = undef;
+ $RA = undef;
+ $ra = Git::SVN::Ra->new($full_url);
+ $ra_invalid = 1;
+ } elsif ($old_url ne $full_url) {
+ SVN::_Ra::svn_ra_reparent($self->{session}, $full_url, $pool);
+ $self->{url} = $full_url;
+ $reparented = 1;
}
+
$ra ||= $self;
my $reporter = $ra->do_switch($rev_b, '', 1, $url_b, $editor, $pool);
my @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef) : ();