Re: [PATCH 3/3] diff-index: pass pathspec down to unpack-trees machinery
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 18 quoted lines
> 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.
Show 26 quoted lines
> ... Or perhaps the right fix would be this
> instead
>
> diff --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(const
> struct 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?