summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2007-02-23 10:21:59 (GMT)
committerEric Wong <normalperson@yhbt.net>2007-02-23 10:21:59 (GMT)
commit2e5e24803fc92a1da5b941495dc22f888fc612b6 (patch)
tree362748d3d28baabaed9abb7472e69925268ee53a /git-svn.perl
parente2c475d91cc65b110a20c9836142a4a7e608a87c (diff)
downloadgit-2e5e24803fc92a1da5b941495dc22f888fc612b6.zip
git-2e5e24803fc92a1da5b941495dc22f888fc612b6.tar.gz
git-2e5e24803fc92a1da5b941495dc22f888fc612b6.tar.bz2
git-svn: fix some potential bugs with --follow-parent
When using do_switch: We only need to ensure the index is clean and set to that of the parent tree) we rely on being able to reconstruct full files with deltas transferred over the network. When using do_update: We may safely unlink the index if we are fetching an entire new tree with do_update. Having an old index (from a previously deleted/abandoned directory) around can cause irrelevant files to be mistakenly kept. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 2bd70a1..41961b5 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1675,9 +1675,9 @@ sub find_parent_branch {
}
if (defined $r0 && defined $parent) {
print STDERR "Found branch parent: ($self->{ref_id}) $parent\n";
- $self->assert_index_clean($parent);
my $ed;
if ($self->ra->can_do_switch) {
+ $self->assert_index_clean($parent);
print STDERR "Following parent with do_switch\n";
# do_switch works with svn/trunk >= r22312, but that
# is not included with SVN 1.4.3 (the latest version
@@ -2932,6 +2932,10 @@ sub gs_do_update {
my $new = ($rev_a == $rev_b);
my $path = $gs->{path};
+ if ($new && -e $gs->{index}) {
+ unlink $gs->{index} or die
+ "Couldn't unlink index: $gs->{index}: $!\n";
+ }
my $pool = SVN::Pool->new;
$editor->set_path_strip($path);
my (@pc) = split m#/#, $path;