From: Michael J. Kiwala Date: Tue, 1 Jun 2010 21:24:57 +0000 (-0500) Subject: git svn: fix empty directory creation X-Git-Tag: v1.7.2-rc0~97 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7c42e390a37a11b1f7a77f5f07c261a8f930663a;p=git.git 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 Signed-off-by: Michael J. Kiwala --- diff --git a/git-svn.perl b/git-svn.perl index b3b6964f9..09c4ca56f 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -2836,8 +2836,9 @@ sub mkemptydirs { foreach my $d (sort keys %empty_dirs) { $d = uri_decode($d); $d =~ s/$strip//; + next unless length($d); next if -d $d; - if (-e _) { + if (-e $d) { warn "$d exists but is not a directory\n"; } else { print "creating empty directory: $d\n";