@matheusbsbs / matheus-bagliano / commits / a2003abc23
Fork 0

git-svn: allow --follow-parent on deleted directories

Any operations on the index in Git::SVN that is not wrapped by tmp_index_do() is wrong. Signed-off-by: Eric Wong <normalperson@yhbt.net>

Eric Wong committed Jan 22, 2007 at 15:22 UTC a2003abc23a5961534e8a0cc70b881eb78d54328
2 files changed +13 -1
git-svn.perl
+1 -1
@@ -1091,7 +1091,7 @@ sub find_parent_branch {
1091 }
1092 if (defined $r0 && defined $parent && $gs->revisions_eq($r0, $r)) {
1093 print STDERR "Found branch parent: ($self->{ref_id}) $parent\n";
1094 - command_noisy('read-tree', $parent);
1094 + $self->assert_index_clean($parent);
1095 my $ed;
1096 if ($self->ra->can_do_switch) {
1097 print STDERR "Following parent with do_switch\n";
t/t9104-git-svn-follow-parent.sh
+12
@@ -49,6 +49,18 @@ test_expect_success 'init and fetch from one svn-remote' "
49 sed -n -e '3p'\`\" = goodbye
50 "
51
52 +test_expect_success 'follow deleted parent' "
53 + svn cp -m 'resurrecting trunk as junk' \
54 + -r2 $svnrepo/trunk $svnrepo/junk &&
55 + git-repo-config --add svn-remote.git-svn.fetch \
56 + junk:refs/remotes/svn/junk &&
57 + git-svn fetch --follow-parent -i svn/thunk &&
58 + git-svn fetch -i svn/junk --follow-parent &&
59 + test -z \"\`git diff svn/junk svn/trunk\`\" &&
60 + test \"\`git merge-base svn/junk svn/trunk\`\" \
61 + = \"\`git rev-parse svn/trunk\`\"
62 + "
63 +
64 test_debug 'gitk --all &'
65
66 test_done