aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-svn.perl2
-rwxr-xr-xt/t9104-git-svn-follow-parent.sh12
2 files changed, 13 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl
index f01fb9a35..88c022701 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1091,7 +1091,7 @@ sub find_parent_branch {
}
if (defined $r0 && defined $parent && $gs->revisions_eq($r0, $r)) {
print STDERR "Found branch parent: ($self->{ref_id}) $parent\n";
- command_noisy('read-tree', $parent);
+ $self->assert_index_clean($parent);
my $ed;
if ($self->ra->can_do_switch) {
print STDERR "Following parent with do_switch\n";
diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh
index 3afec978d..402b614c7 100755
--- a/t/t9104-git-svn-follow-parent.sh
+++ b/t/t9104-git-svn-follow-parent.sh
@@ -49,6 +49,18 @@ test_expect_success 'init and fetch from one svn-remote' "
sed -n -e '3p'\`\" = goodbye
"
+test_expect_success 'follow deleted parent' "
+ svn cp -m 'resurrecting trunk as junk' \
+ -r2 $svnrepo/trunk $svnrepo/junk &&
+ git-repo-config --add svn-remote.git-svn.fetch \
+ junk:refs/remotes/svn/junk &&
+ git-svn fetch --follow-parent -i svn/thunk &&
+ git-svn fetch -i svn/junk --follow-parent &&
+ test -z \"\`git diff svn/junk svn/trunk\`\" &&
+ test \"\`git merge-base svn/junk svn/trunk\`\" \
+ = \"\`git rev-parse svn/trunk\`\"
+ "
+
test_debug 'gitk --all &'
test_done