git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git svn: fix empty directory creation

From
EWEric Wong <normalperson@yhbt.net>
Date
Jun 3, 2010, 20:58 UTC
Message-ID
<20100603205850.GA1540@dcvr.yhbt.net>
In-Reply-To
<4C07B7E8.10909@genome.wustl.edu>
Hi Junio,
I've acked and pushed this patch out from Michael to
  git://git.bogomips.org/git-svn.git
>From 7c42e390a37a11b1f7a77f5f07c261a8f930663a Mon Sep 17 00:00:00 2001
From: Michael J. Kiwala <mkiwala@genome.wustl.edu>
Date: Tue, 1 Jun 2010 16:24:57 -0500
Subject: [PATCH] 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>
---
 git-svn.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index b3b6964..09c4ca5 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";
-- 
Eric Wong
Message 1 of 1 in “git svn: fix empty directory creation”
  1. git svn: fix empty directory creationEric Wong, Jun 3, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.