summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcontrib/git-svn/git-svn.perl9
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index d4b9323694..54f3d6312e 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -262,7 +262,14 @@ sub fetch {
} else {
chdir $SVN_WC or croak $!;
read_uuid();
- $last_commit = file_to_s("$REV_DIR/$base->{revision}");
+ eval { $last_commit = file_to_s("$REV_DIR/$base->{revision}") };
+ # looks like a user manually cp'd and svn switch'ed
+ unless ($last_commit) {
+ sys(qw/svn revert -R ./);
+ assert_svn_wc_clean($base->{revision});
+ $last_commit = git_commit($base, @parents);
+ assert_tree($last_commit);
+ }
}
my @svn_up = qw(svn up);
push @svn_up, '--ignore-externals' unless $_no_ignore_ext;