entry: fix filter lookup

When looking up the stream filter, write_entry() should be passing the
path of the file in the repository, not the path to which the content is
going to be written.  This allows the file to be correctly looked up
against the .gitattributes files in the working tree.

This change makes the streaming case match the non-streaming case which
passes ce->name to convert_to_working_tree later in the same function.

The two tests added here test the different paths through write_entry
since the CRLF filter is a streaming filter but the user-defined smudge
filter is not streamed.

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