Teach read-tree 2-way merge to ignore intermediate symlinks

Earlier in 16a4c61, we taught "read-tree -m -u" not to be
confused when switching from a branch that has a path frotz/filfre
to another branch that has a symlink frotz that points at xyzzy/
directory.  The fix was incomplete in that it was still confused
when coming back (i.e. switching from a branch with frotz -> xyzzy/
to another branch with frotz/filfre).

This fix is rather expensive in that for a path that is created
we would need to see if any of the leading component of that
path exists as a symbolic link in the filesystem (in which case,
we know that path itself does not exist, and the fact we already
decided to check it out tells us that in the index we already
know that symbolic link is going away as there is no D/F
conflict).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 files changed
tree: 2ca7b64232eb410bd24d679a422263154392bb43
  1. .gitignore
  2. .mailmap
  3. COPYING
  4. Documentation/
  5. GIT-VERSION-GEN
  6. INSTALL
  7. Makefile
  8. README
  9. alloc.c
  10. archive-tar.c
  11. archive-zip.c
  12. archive.h
  13. arm/
  14. attr.c
  15. attr.h
  16. base85.c
  17. blob.c
  18. blob.h
  19. builtin-add.c
  20. builtin-annotate.c
  21. builtin-apply.c
  22. builtin-archive.c
  23. builtin-blame.c
  24. builtin-branch.c
  25. builtin-bundle.c
  26. builtin-cat-file.c
  27. builtin-check-attr.c
  28. builtin-check-ref-format.c
  29. builtin-checkout-index.c
  30. builtin-commit-tree.c
  31. builtin-config.c
  32. builtin-count-objects.c
  33. builtin-describe.c
  34. builtin-diff-files.c
  35. builtin-diff-index.c
  36. builtin-diff-tree.c
  37. builtin-diff.c
  38. builtin-fetch--tool.c
  39. builtin-fmt-merge-msg.c
  40. builtin-for-each-ref.c
  41. builtin-fsck.c
  42. builtin-gc.c
  43. builtin-grep.c
  44. builtin-init-db.c
  45. builtin-log.c
  46. builtin-ls-files.c
  47. builtin-ls-tree.c
  48. builtin-mailinfo.c
  49. builtin-mailsplit.c
  50. builtin-merge-base.c
  51. builtin-merge-file.c
  52. builtin-mv.c
  53. builtin-name-rev.c
  54. builtin-pack-objects.c
  55. builtin-pack-refs.c
  56. builtin-prune-packed.c
  57. builtin-prune.c
  58. builtin-push.c
  59. builtin-read-tree.c
  60. builtin-reflog.c
  61. builtin-rerere.c
  62. builtin-rev-list.c
  63. builtin-rev-parse.c
  64. builtin-revert.c
  65. builtin-rm.c
  66. builtin-runstatus.c
  67. builtin-shortlog.c
  68. builtin-show-branch.c
  69. builtin-show-ref.c
  70. builtin-stripspace.c
  71. builtin-symbolic-ref.c
  72. builtin-tar-tree.c
  73. builtin-unpack-objects.c
  74. builtin-update-index.c
  75. builtin-update-ref.c
  76. builtin-upload-archive.c
  77. builtin-verify-pack.c
  78. builtin-write-tree.c
  79. builtin.h
  80. cache-tree.c
  81. cache-tree.h
  82. cache.h
  83. check-builtins.sh
  84. check-racy.c
  85. color.c
  86. color.h
  87. combine-diff.c
  88. commit.c
  89. commit.h
  90. compat/
  91. config.c
  92. config.mak.in
  93. configure.ac
  94. connect.c
  95. contrib/
  96. convert-objects.c
  97. convert.c
  98. copy.c
  99. csum-file.c
  100. csum-file.h
  101. ctype.c
  102. daemon.c
  103. date.c
  104. decorate.c
  105. decorate.h
  106. delta.h
  107. diff-delta.c
  108. diff-lib.c
  109. diff.c
  110. diff.h
  111. diffcore-break.c
  112. diffcore-delta.c
  113. diffcore-order.c
  114. diffcore-pickaxe.c
  115. diffcore-rename.c
  116. diffcore.h
  117. dir.c
  118. dir.h
  119. dump-cache-tree.c
  120. entry.c
  121. environment.c
  122. exec_cmd.c
  123. exec_cmd.h
  124. fast-import.c
  125. fetch-pack.c
  126. fetch.c
  127. fetch.h
  128. generate-cmdlist.sh
  129. git-add--interactive.perl
  130. git-am.sh
  131. git-applymbox.sh
  132. git-applypatch.sh
  133. git-archimport.perl
  134. git-bisect.sh
  135. git-checkout.sh
  136. git-clean.sh
  137. git-clone.sh
  138. git-commit.sh
  139. git-compat-util.h
  140. git-cvsexportcommit.perl
  141. git-cvsimport.perl
  142. git-cvsserver.perl
  143. git-fetch.sh
  144. git-gui/
  145. git-instaweb.sh
  146. git-lost-found.sh
  147. git-ls-remote.sh
  148. git-merge-octopus.sh
  149. git-merge-one-file.sh
  150. git-merge-ours.sh
  151. git-merge-resolve.sh
  152. git-merge-stupid.sh
  153. git-merge.sh
  154. git-mergetool.sh
  155. git-p4import.py
  156. git-parse-remote.sh
  157. git-pull.sh
  158. git-quiltimport.sh
  159. git-rebase.sh
  160. git-relink.perl
  161. git-remote.perl
  162. git-repack.sh
  163. git-request-pull.sh
  164. git-reset.sh
  165. git-send-email.perl
  166. git-sh-setup.sh
  167. git-svn.perl
  168. git-svnimport.perl
  169. git-tag.sh
  170. git-verify-tag.sh
  171. git.c
  172. git.spec.in
  173. gitk
  174. gitweb/
  175. grep.c
  176. grep.h
  177. hash-object.c
  178. help.c
  179. http-fetch.c
  180. http-push.c
  181. http.c
  182. http.h
  183. ident.c
  184. imap-send.c
  185. index-pack.c
  186. interpolate.c
  187. interpolate.h
  188. list-objects.c
  189. list-objects.h
  190. local-fetch.c
  191. lockfile.c
  192. log-tree.c
  193. log-tree.h
  194. mailmap.c
  195. mailmap.h
  196. match-trees.c
  197. merge-file.c
  198. merge-index.c
  199. merge-recursive.c
  200. merge-tree.c
  201. mktag.c
  202. mktree.c
  203. mozilla-sha1/
  204. object-refs.c
  205. object.c
  206. object.h
  207. pack-check.c
  208. pack-redundant.c
  209. pack-write.c
  210. pack.h
  211. pager.c
  212. patch-delta.c
  213. patch-id.c
  214. patch-ids.c
  215. patch-ids.h
  216. path-list.c
  217. path-list.h
  218. path.c
  219. peek-remote.c
  220. perl/
  221. pkt-line.c
  222. pkt-line.h
  223. ppc/
  224. progress.c
  225. progress.h
  226. quote.c
  227. quote.h
  228. reachable.c
  229. reachable.h
  230. read-cache.c
  231. receive-pack.c
  232. reflog-walk.c
  233. reflog-walk.h
  234. refs.c
  235. refs.h
  236. revision.c
  237. revision.h
  238. rsh.c
  239. rsh.h
  240. run-command.c
  241. run-command.h
  242. send-pack.c
  243. server-info.c
  244. setup.c
  245. sha1_file.c
  246. sha1_name.c
  247. shallow.c
  248. shell.c
  249. show-index.c
  250. sideband.c
  251. sideband.h
  252. ssh-fetch.c
  253. ssh-pull.c
  254. ssh-push.c
  255. ssh-upload.c
  256. strbuf.c
  257. strbuf.h
  258. symlinks.c
  259. t/
  260. tag.c
  261. tag.h
  262. tar.h
  263. templates/
  264. test-chmtime.c
  265. test-date.c
  266. test-delta.c
  267. test-genrandom.c
  268. test-match-trees.c
  269. test-sha1.c
  270. test-sha1.sh
  271. trace.c
  272. tree-diff.c
  273. tree-walk.c
  274. tree-walk.h
  275. tree.c
  276. tree.h
  277. unpack-file.c
  278. unpack-trees.c
  279. unpack-trees.h
  280. update-server-info.c
  281. upload-pack.c
  282. usage.c
  283. utf8.c
  284. utf8.h
  285. var.c
  286. write_or_die.c
  287. wt-status.c
  288. wt-status.h
  289. xdiff-interface.c
  290. xdiff-interface.h
  291. xdiff/