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

Re: [PATCH] ls-files: fix overeager pathspec optimization

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:47:59

Possibly related (same subject, not in this thread)


On Sat, 9 Jan 2010, Junio C Hamano wrote:
quoted hunk ↗ jump to hunk
Having sent these patches, I am wondering if the simplest fix might be this
one-liner.
diff --git a/dir.c b/dir.c
index d0999ba..7fba335 100644
--- a/dir.c
+++ b/dir.c
@@ -788,3 +788,3 @@ int read_directory(struct dir_struct *dir, const char *path, int len, const char
 	simplify = create_simplify(pathspec);
-	read_directory_recursive(dir, path, len, 0, simplify);
+	read_directory_recursive(dir, "", 0, 0, simplify);
 	free_simplify(simplify);
That one-liner doesn't work at all for me.

Lookie here:

	[torvalds@nehalem linux]$ touch drivers/char/hello.c
	[torvalds@nehalem linux]$ ~/git/git ls-files --exclude-standard -o drivers/char
	[torvalds@nehalem linux]$ git ls-files --exclude-standard -o drivers/char
	drivers/char/hello.c

where that ~/git/git is the version with the one-liner.

IOW, it now ignores _everything_, because the dir and the path don't 
match.

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help