@matheusbsbs / matheus-bagliano / commits / 7c42e390a3
Fork 0

git svn: fix empty directory creation

Avoid attempts to stat() the contents of '', which could happen when the root directory is empty. Additionally, remove the unnecessary '_' stat optimization since it was confusing and possibly throwing off the non-existent case. [ew: fixed indentation, rewrote commit message] Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Michael J. Kiwala <mkiwala@genome.wustl.edu>

Michael J. Kiwala committed Jun 1, 2010 at 16:24 UTC 7c42e390a37a11b1f7a77f5f07c261a8f930663a
1 file changed +2 -1
git-svn.perl
+2 -1
@@ -2836,8 +2836,9 @@ sub mkemptydirs {
2836 foreach my $d (sort keys %empty_dirs) {
2837 $d = uri_decode($d);
2838 $d =~ s/$strip//;
2839 + next unless length($d);
2840 next if -d $d;
2840 - if (-e _) {
2841 + if (-e $d) {
2842 warn "$d exists but is not a directory\n";
2843 } else {
2844 print "creating empty directory: $d\n";