Skip to content

Commit

Permalink
git svn: log removals of empty directories
Browse files Browse the repository at this point in the history
This also adds a test case for:
  "git svn: Don't create empty directories whose parents were deleted"
which was the reason we found this bug in the first place.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
  • Loading branch information
Eric Wong committed Dec 8, 2009
1 parent 33f2a31 commit f9ad77a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -3891,11 +3891,11 @@ sub delete_entry {
}
print "\tD\t$gpath/\n" unless $::_q;
command_close_pipe($ls, $ctx);
$self->{empty}->{$path} = 0
} else {
$self->{gii}->remove($gpath);
print "\tD\t$gpath\n" unless $::_q;
}
$self->{empty}->{$path} = 0;
undef;
}

Expand Down
10 changes: 10 additions & 0 deletions t/t9146-git-svn-empty-dirs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,14 @@ test_expect_success 'empty directories in trunk exist' '
)
'

test_expect_success 'remove a top-level directory from svn' '
svn_cmd rm -m "remove d" "$svnrepo"/d
'

test_expect_success 'removed top-level directory does not exist' '
git svn clone "$svnrepo" removed &&
test ! -e removed/d
'

test_done

0 comments on commit f9ad77a

Please sign in to comment.