Thread (12 messages) flat view 12 messages, 3 authors, 2016-06-15

Re: [PATCH v3] fast-import: allow 'ls' and filecopy to read the root

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:53:16

Jonathan Nieder wrote:
It has a semantic conflict with the fast-import-ls-fixes series that
I sent separately
[...]
I'll send a fixup patch as a reply, for squashing into the merge or
this patch, whichever is the first commit that contains both topics.
With this tweak, the merge passes the merged set of tests.
diff --git i/fast-import.c c/fast-import.c
index 51cdda29..fe1c8643 100644
--- i/fast-import.c
+++ c/fast-import.c
@@ -1658,8 +1658,6 @@ static int tree_content_get(
 		n = slash1 - p;
 	else
 		n = strlen(p);
-	if (!n)
-		die("Empty path component found in input");
 
 	if (!root->tree)
 		load_tree(root);
@@ -1669,6 +1667,8 @@ static int tree_content_get(
 		if (e->name->str_len == n && !strncmp_icase(p, e->name->str_dat, n)) {
 			if (!slash1)
 				goto last_component;
+			if (!slash1[1])
+				die("Empty path component found in input");
 			if (!S_ISDIR(e->versions[1].mode))
 				return 0;
 			if (!e->tree)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help