git-svn: handle our top-level path being deleted and later re-added

Previously, git-svn would ignore cases where the path we're
tracking is removed from the repository.  This was to prevent
heads with follow-parent from ending up with a tree full of
empty revisions (and thus breaking rename detection).

The previous behavior is fine until the path we're tracking
is re-added later on, leading to the old files being merged
in with the new files in the directory (because the old
files were never marked as deleted)

We will now only remove all the old files locally that were
deleted remotely iff we detect the directory we're in is being
created from scratch.

Thanks for Marcus D. Hanwell for the bug report and
Peter Baumann for the analysis.

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