summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorGreg Price <price@ksplice.com>2009-12-08 03:28:32 (GMT)
committerEric Wong <normalperson@yhbt.net>2009-12-08 04:47:08 (GMT)
commit33f2a3108eeacbd937021470aa6e67c01ceec960 (patch)
tree60355f3f6d28b1963a2e9e99e6a505f1e4c1aca1 /git-svn.perl
parente9e4c8b7473f6ee21f452c66430a0763681243d7 (diff)
downloadgit-33f2a3108eeacbd937021470aa6e67c01ceec960.zip
git-33f2a3108eeacbd937021470aa6e67c01ceec960.tar.gz
git-33f2a3108eeacbd937021470aa6e67c01ceec960.tar.bz2
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 <broder@mit.edu> Signed-off-by: Greg Price <price@ksplice.com> Acked-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 51f03ad..bdd1f96 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2748,7 +2748,8 @@ sub mkemptydirs {
} elsif (/^ \+empty_dir: (.+)$/) {
$empty_dirs{$1} = 1;
} elsif (/^ \-empty_dir: (.+)$/) {
- delete $empty_dirs{$1};
+ my @d = grep {m[^\Q$1\E(/|$)]} (keys %empty_dirs);
+ delete @empty_dirs{@d};
}
}
close $fh;