Skip to content

Commit

Permalink
git svn: fix empty directory creation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael J. Kiwala authored and Eric Wong committed Jun 3, 2010
1 parent bdc4204 commit 7c42e39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 7c42e39

Please sign in to comment.