Re: [PATCH 3/3] diff-index: pass pathspec down to unpack-trees machinery
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:52:46
Nguyen Thai Ngoc Duy [off-list ref] writes:
quoted hunk
This seems to fix this.diff --git a/unpack-trees.c b/unpack-trees.c index 7c9ecf6..5cf58b6 100644 --- a/unpack-trees.c +++ b/unpack-trees.c@@ -1042,6 +1042,7 @@ int unpack_trees(unsigned len, struct tree_desc*t, struct unpack_trees_options info.data = o; info.show_all_errors = o->show_all_errors; info.pathspec = o->pathspec; + info.pathspec->recursive = 1; if (o->prefix) { /* Still scratching my head why this flag is zero by default, which would affect all other places.
Ahh, thanks for diagnosing.
quoted hunk
... Or perhaps the right fix would be this insteaddiff --git a/tree-walk.c b/tree-walk.c index f82dba6..0345938 100644 --- a/tree-walk.c +++ b/tree-walk.c@@ -634,7 +634,7 @@ enum interesting tree_entry_interesting(conststruct name_entry *entry, * Match all directories. We'll try to * match files later on. */ - if (ps->recursive && S_ISDIR(entry->mode)) + if (S_ISDIR(entry->mode)) return entry_interesting; }@@ -662,7 +662,7 @@ match_wildcards: * Match all directories. We'll try to match files * later on. */ - if (ps->recursive && S_ISDIR(entry->mode)) + if (S_ISDIR(entry->mode)) return entry_interesting; } return never_interesting; /* No matches */
Doesn't that break "git diff-tree A B" without the "-r" option?