Thread (1 message) 1 message, 1 author, 2016-06-15
DORMANTno replies

[PATCH] tree_entry_interesting(): with no pathspecs, everything will match

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:29
Subsystem: the rest · Maintainer: Linus Torvalds

Hence the function should return "2" in such a case as advertised.

Note that finding a directory that busts the depth limit does not mean non
directories at the same level would also bust the limit (they don't), so
we still need to return 1, not 2 in the within_depth() codepath.

Signed-off-by: Junio C Hamano <redacted>
--- 

  Nguyen Thai Ngoc Duy [off-list ref] writes:

  >> When depth check is in effect, the result depends on the mode of the
  >> entry, so we cannot short-circuit by returning 2, but at least we should
  >> do so when (max_depth == -1), no?
  >
  > Yes, should be 2.

  Thanks.  I'll queue this.

 tree-walk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tree-walk.c b/tree-walk.c
index 9b43ad5..ece8cc0 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -560,7 +560,7 @@ int tree_entry_interesting(const struct name_entry *entry,
 
 	if (!ps->nr) {
 		if (!ps->recursive || ps->max_depth == -1)
-			return 1;
+			return 2;
 		return !!within_depth(base->buf + base_offset, baselen,
 				      !!S_ISDIR(entry->mode),
 				      ps->max_depth);
-- 
1.7.4.261.g705f2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help