Make unpack-tree update removed files before any updated files

This is immaterial on sane filesystems, but if you have a broken (aka
case-insensitive) filesystem, and the objective is to remove the file
'abc' and replace it with the file 'Abc', then we must make sure to do
the removal first.

Otherwise, you'd first update the file 'Abc' - which would just
overwrite the file 'abc' due to the broken case-insensitive filesystem -
and then remove file 'abc' - which would now brokenly remove the just
updated file 'Abc' on that broken filesystem.

By doing removals first, this won't happen.

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