Skip to content

Commit f9ad77a

Browse files
author
Eric Wong
committed
git svn: log removals of empty directories
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 <[email protected]>
1 parent 33f2a31 commit f9ad77a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

git-svn.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3891,11 +3891,11 @@ sub delete_entry {
38913891
}
38923892
print "\tD\t$gpath/\n" unless $::_q;
38933893
command_close_pipe($ls, $ctx);
3894-
$self->{empty}->{$path} = 0
38953894
} else {
38963895
$self->{gii}->remove($gpath);
38973896
print "\tD\t$gpath\n" unless $::_q;
38983897
}
3898+
$self->{empty}->{$path} = 0;
38993899
undef;
39003900
}
39013901

t/t9146-git-svn-empty-dirs.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,14 @@ test_expect_success 'empty directories in trunk exist' '
105105
)
106106
'
107107

108+
test_expect_success 'remove a top-level directory from svn' '
109+
svn_cmd rm -m "remove d" "$svnrepo"/d
110+
'
111+
112+
test_expect_success 'removed top-level directory does not exist' '
113+
git svn clone "$svnrepo" removed &&
114+
test ! -e removed/d
115+
116+
'
117+
108118
test_done

0 commit comments

Comments
 (0)