Skip to content

Commit 33f2a31

Browse files
Greg PriceEric Wong
authored andcommitted
git svn: Don't create empty directories whose parents were deleted
Commit 6111b93 "git svn: attempt to create empty dirs on clone+rebase" will create empty directories 'a/b' and 'a/c' if they were previously created in SVN, even if their parent directory 'a' was deleted. For example, unhandled.log may contain lines like this: r32 +empty_dir: packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/etc/remctl/sipb-xen-auto/acl +empty_dir: packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/etc/remctl/sipb-xen-auto/machine.d +empty_dir: packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/etc/remctl/sipb-xen-auto/moira-acl [...] r314 -empty_dir: packages/sipb-xen-remctl-auto [ew: rewrote to be line-wrapped at <= 80-columns] Reported-by: Evan Broder <[email protected]> Signed-off-by: Greg Price <[email protected]> Acked-by: Eric Wong <[email protected]>
1 parent e9e4c8b commit 33f2a31

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git-svn.perl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2748,7 +2748,8 @@ sub mkemptydirs {
27482748
} elsif (/^ \+empty_dir: (.+)$/) {
27492749
$empty_dirs{$1} = 1;
27502750
} elsif (/^ \-empty_dir: (.+)$/) {
2751-
delete $empty_dirs{$1};
2751+
my @d = grep {m[^\Q$1\E(/|$)]} (keys %empty_dirs);
2752+
delete @empty_dirs{@d};
27522753
}
27532754
}
27542755
close $fh;

0 commit comments

Comments
 (0)