{"thread":{"id":"23998","subject":"[PATCH] git svn: fix empty directory creation","startedAt":"2010-06-03T20:58:50Z","lastAt":"2010-06-03T20:58:50Z","messageCount":1,"participants":["Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"142926","messageId":"20100603205850.GA1540@dcvr.yhbt.net","threadId":"23998","inReplyTo":"4C07B7E8.10909@genome.wustl.edu","subject":"[PATCH] git svn: fix empty directory creation","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-06-03T20:58:50Z","receivedAt":"2010-06-03T20:58:50Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Hi Junio,\n\nI've acked and pushed this patch out from Michael to\n\n  git://git.bogomips.org/git-svn.git\n\n>From 7c42e390a37a11b1f7a77f5f07c261a8f930663a Mon Sep 17 00:00:00 2001\nFrom: Michael J. Kiwala <mkiwala@genome.wustl.edu>\nDate: Tue, 1 Jun 2010 16:24:57 -0500\nSubject: [PATCH] git svn: fix empty directory creation\n\nAvoid attempts to stat() the contents of '', which could happen\nwhen the root directory is empty.  Additionally, remove the\nunnecessary '_' stat optimization since it was confusing and\npossibly throwing off the non-existent case.\n\n[ew: fixed indentation, rewrote commit message]\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\nSigned-off-by: Michael J. Kiwala <mkiwala@genome.wustl.edu>\n---\n git-svn.perl |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex b3b6964..09c4ca5 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -2836,8 +2836,9 @@ sub mkemptydirs {\n \tforeach my $d (sort keys %empty_dirs) {\n \t\t$d = uri_decode($d);\n \t\t$d =~ s/$strip//;\n+\t\tnext unless length($d);\n \t\tnext if -d $d;\n-\t\tif (-e _) {\n+\t\tif (-e $d) {\n \t\t\twarn \"$d exists but is not a directory\\n\";\n \t\t} else {\n \t\t\tprint \"creating empty directory: $d\\n\";\n-- \nEric Wong\n"}]}