diff options
author | Greg Price <price@ksplice.com> | 2009-12-08 04:28:32 +0100 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-12-08 05:47:08 +0100 |
commit | 33f2a3108eeacbd937021470aa6e67c01ceec960 (patch) | |
tree | 60355f3f6d28b1963a2e9e99e6a505f1e4c1aca1 /git-svn.perl | |
parent | git-svn: sort svk merge tickets to account for minimal parents (diff) | |
download | git-33f2a3108eeacbd937021470aa6e67c01ceec960.tar.xz git-33f2a3108eeacbd937021470aa6e67c01ceec960.zip |
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-x | git-svn.perl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl index 51f03adb9b..bdd1f966c3 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; |