diff-index: enable recursive pathspec matching in unpack_trees

The pathspec structure has a few bits of data to drive various operation
modes after we unified the pathspec matching logic in various codepaths.
For example, max_depth field is there so that "git grep" can limit the
output for files found in limited depth of tree traversal. Also in order
to show just the surface level differences in "git diff-tree", recursive
field stops us from descending into deeper level of the tree structure
when it is set to false, and this also affects pathspec matching when
we have wildcards in the pathspec.

The diff-index has always wanted the recursive behaviour, and wanted to
match pathspecs without any depth limit. But we forgot to do so when we
updated tree_entry_interesting() logic to unify the pathspec matching
logic.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 files changed
tree: cefe187625110427649711f166df18615ad62f23
  1. .gitattributes
  2. .gitignore
  3. .mailmap
  4. COPYING
  5. Documentation/
  6. GIT-VERSION-GEN
  7. INSTALL
  8. LGPL-2.1
  9. Makefile
  10. README
  11. abspath.c
  12. aclocal.m4
  13. advice.c
  14. advice.h
  15. alias.c
  16. alloc.c
  17. archive-tar.c
  18. archive-zip.c
  19. archive.c
  20. archive.h
  21. argv-array.c
  22. argv-array.h
  23. attr.c
  24. attr.h
  25. base85.c
  26. bisect.c
  27. bisect.h
  28. blob.c
  29. blob.h
  30. block-sha1/
  31. branch.c
  32. branch.h
  33. builtin.h
  34. builtin/
  35. bundle.c
  36. bundle.h
  37. cache-tree.c
  38. cache-tree.h
  39. cache.h
  40. check-builtins.sh
  41. check-racy.c
  42. check_bindir
  43. color.c
  44. color.h
  45. combine-diff.c
  46. command-list.txt
  47. commit.c
  48. commit.h
  49. compat/
  50. config.c
  51. config.mak.in
  52. configure.ac
  53. connect.c
  54. contrib/
  55. convert.c
  56. convert.h
  57. copy.c
  58. csum-file.c
  59. csum-file.h
  60. ctype.c
  61. daemon.c
  62. date.c
  63. decorate.c
  64. decorate.h
  65. delta.h
  66. diff-delta.c
  67. diff-lib.c
  68. diff-no-index.c
  69. diff.c
  70. diff.h
  71. diffcore-break.c
  72. diffcore-delta.c
  73. diffcore-order.c
  74. diffcore-pickaxe.c
  75. diffcore-rename.c
  76. diffcore.h
  77. dir.c
  78. dir.h
  79. editor.c
  80. entry.c
  81. environment.c
  82. exec_cmd.c
  83. exec_cmd.h
  84. fast-import.c
  85. fetch-pack.h
  86. fixup-builtins
  87. fsck.c
  88. fsck.h
  89. generate-cmdlist.sh
  90. gettext.c
  91. gettext.h
  92. git-add--interactive.perl
  93. git-am.sh
  94. git-archimport.perl
  95. git-bisect.sh
  96. git-compat-util.h
  97. git-cvsexportcommit.perl
  98. git-cvsimport.perl
  99. git-cvsserver.perl
  100. git-difftool--helper.sh
  101. git-difftool.perl
  102. git-filter-branch.sh
  103. git-gui/
  104. git-instaweb.sh
  105. git-lost-found.sh
  106. git-merge-octopus.sh
  107. git-merge-one-file.sh
  108. git-merge-resolve.sh
  109. git-mergetool--lib.sh
  110. git-mergetool.sh
  111. git-parse-remote.sh
  112. git-pull.sh
  113. git-quiltimport.sh
  114. git-rebase--am.sh
  115. git-rebase--interactive.sh
  116. git-rebase--merge.sh
  117. git-rebase.sh
  118. git-relink.perl
  119. git-remote-testgit.py
  120. git-repack.sh
  121. git-request-pull.sh
  122. git-send-email.perl
  123. git-sh-i18n.sh
  124. git-sh-setup.sh
  125. git-stash.sh
  126. git-submodule.sh
  127. git-svn.perl
  128. git-web--browse.sh
  129. git.c
  130. git.spec.in
  131. git_remote_helpers/
  132. gitk-git/
  133. gitweb/
  134. graph.c
  135. graph.h
  136. grep.c
  137. grep.h
  138. hash.c
  139. hash.h
  140. help.c
  141. help.h
  142. hex.c
  143. http-backend.c
  144. http-fetch.c
  145. http-push.c
  146. http-walker.c
  147. http.c
  148. http.h
  149. ident.c
  150. imap-send.c
  151. kwset.c
  152. kwset.h
  153. levenshtein.c
  154. levenshtein.h
  155. list-objects.c
  156. list-objects.h
  157. ll-merge.c
  158. ll-merge.h
  159. lockfile.c
  160. log-tree.c
  161. log-tree.h
  162. mailmap.c
  163. mailmap.h
  164. match-trees.c
  165. merge-file.c
  166. merge-file.h
  167. merge-recursive.c
  168. merge-recursive.h
  169. mergetools/
  170. name-hash.c
  171. notes-cache.c
  172. notes-cache.h
  173. notes-merge.c
  174. notes-merge.h
  175. notes.c
  176. notes.h
  177. object.c
  178. object.h
  179. pack-check.c
  180. pack-refs.c
  181. pack-refs.h
  182. pack-revindex.c
  183. pack-revindex.h
  184. pack-write.c
  185. pack.h
  186. pager.c
  187. parse-options-cb.c
  188. parse-options.c
  189. parse-options.h
  190. patch-delta.c
  191. patch-ids.c
  192. patch-ids.h
  193. path.c
  194. perl/
  195. pkt-line.c
  196. pkt-line.h
  197. po/
  198. ppc/
  199. preload-index.c
  200. pretty.c
  201. progress.c
  202. progress.h
  203. quote.c
  204. quote.h
  205. reachable.c
  206. reachable.h
  207. read-cache.c
  208. reflog-walk.c
  209. reflog-walk.h
  210. refs.c
  211. refs.h
  212. remote-curl.c
  213. remote.c
  214. remote.h
  215. replace_object.c
  216. rerere.c
  217. rerere.h
  218. resolve-undo.c
  219. resolve-undo.h
  220. revision.c
  221. revision.h
  222. run-command.c
  223. run-command.h
  224. send-pack.h
  225. server-info.c
  226. setup.c
  227. sh-i18n--envsubst.c
  228. sha1-array.c
  229. sha1-array.h
  230. sha1-lookup.c
  231. sha1-lookup.h
  232. sha1_file.c
  233. sha1_name.c
  234. shallow.c
  235. shell.c
  236. shortlog.h
  237. show-index.c
  238. sideband.c
  239. sideband.h
  240. sigchain.c
  241. sigchain.h
  242. strbuf.c
  243. strbuf.h
  244. streaming.c
  245. streaming.h
  246. string-list.c
  247. string-list.h
  248. submodule.c
  249. submodule.h
  250. symlinks.c
  251. t/
  252. tag.c
  253. tag.h
  254. tar.h
  255. templates/
  256. test-chmtime.c
  257. test-ctype.c
  258. test-date.c
  259. test-delta.c
  260. test-dump-cache-tree.c
  261. test-genrandom.c
  262. test-index-version.c
  263. test-line-buffer.c
  264. test-match-trees.c
  265. test-mktemp.c
  266. test-obj-pool.c
  267. test-parse-options.c
  268. test-path-utils.c
  269. test-run-command.c
  270. test-sha1.c
  271. test-sha1.sh
  272. test-sigchain.c
  273. test-string-pool.c
  274. test-subprocess.c
  275. test-svn-fe.c
  276. test-treap.c
  277. thread-utils.c
  278. thread-utils.h
  279. trace.c
  280. transport-helper.c
  281. transport.c
  282. transport.h
  283. tree-diff.c
  284. tree-walk.c
  285. tree-walk.h
  286. tree.c
  287. tree.h
  288. unimplemented.sh
  289. unpack-trees.c
  290. unpack-trees.h
  291. upload-pack.c
  292. url.c
  293. url.h
  294. usage.c
  295. userdiff.c
  296. userdiff.h
  297. utf8.c
  298. utf8.h
  299. vcs-svn/
  300. walker.c
  301. walker.h
  302. wrap-for-bin.sh
  303. wrapper.c
  304. write_or_die.c
  305. ws.c
  306. wt-status.c
  307. wt-status.h
  308. xdiff-interface.c
  309. xdiff-interface.h
  310. xdiff/
  311. zlib.c