upload-pack: avoid sending an incomplete pack upon failure

When the repository on the remote side is corrupted, rev-list
spawned from upload-pack would die with error, but pack-objects
that reads from the rev-list happily created a packfile that can
be unpacked by the downloader.  When this happens, the resulting
packfile is not corrupted and unpacks cleanly, but the list of
the objects contained in it is not what the protocol exchange
computed.

This update makes upload-pack to monitor its subprocesses, and
when either of them dies with error, sends an incomplete pack
data to the downloader to cause it to fail.

Signed-off-by: Junio C Hamano <junkio@cox.net>
1 file changed
tree: b30437f3d0cba446ae96105339a23a416f512ba7
  1. arm/
  2. compat/
  3. contrib/
  4. Documentation/
  5. gitweb/
  6. mozilla-sha1/
  7. ppc/
  8. t/
  9. templates/
  10. xdiff/
  11. .gitignore
  12. alloc.c
  13. base85.c
  14. blame.c
  15. blob.c
  16. blob.h
  17. builtin-add.c
  18. builtin-apply.c
  19. builtin-cat-file.c
  20. builtin-check-ref-format.c
  21. builtin-commit-tree.c
  22. builtin-count.c
  23. builtin-diff-files.c
  24. builtin-diff-index.c
  25. builtin-diff-stages.c
  26. builtin-diff-tree.c
  27. builtin-diff.c
  28. builtin-grep.c
  29. builtin-help.c
  30. builtin-init-db.c
  31. builtin-log.c
  32. builtin-ls-files.c
  33. builtin-ls-tree.c
  34. builtin-push.c
  35. builtin-read-tree.c
  36. builtin-rev-list.c
  37. builtin-rev-parse.c
  38. builtin-rm.c
  39. builtin-show-branch.c
  40. builtin-tar-tree.c
  41. builtin-upload-tar.c
  42. builtin.h
  43. cache-tree.c
  44. cache-tree.h
  45. cache.h
  46. checkout-index.c
  47. clone-pack.c
  48. combine-diff.c
  49. commit.c
  50. commit.h
  51. config.c
  52. connect.c
  53. convert-objects.c
  54. copy.c
  55. COPYING
  56. csum-file.c
  57. csum-file.h
  58. ctype.c
  59. daemon.c
  60. date.c
  61. delta.h
  62. describe.c
  63. diff-delta.c
  64. diff-lib.c
  65. diff.c
  66. diff.h
  67. diffcore-break.c
  68. diffcore-delta.c
  69. diffcore-order.c
  70. diffcore-pickaxe.c
  71. diffcore-rename.c
  72. diffcore.h
  73. dir.c
  74. dir.h
  75. dump-cache-tree.c
  76. entry.c
  77. environment.c
  78. exec_cmd.c
  79. exec_cmd.h
  80. fetch-clone.c
  81. fetch-pack.c
  82. fetch.c
  83. fetch.h
  84. fsck-objects.c
  85. generate-cmdlist.sh
  86. git-am.sh
  87. git-annotate.perl
  88. git-applymbox.sh
  89. git-applypatch.sh
  90. git-archimport.perl
  91. git-bisect.sh
  92. git-branch.sh
  93. git-checkout.sh
  94. git-cherry.sh
  95. git-clean.sh
  96. git-clone.sh
  97. git-commit.sh
  98. git-compat-util.h
  99. git-cvsexportcommit.perl
  100. git-cvsimport.perl
  101. git-cvsserver.perl
  102. git-fetch.sh
  103. git-fmt-merge-msg.perl
  104. git-lost-found.sh
  105. git-ls-remote.sh
  106. git-merge-octopus.sh
  107. git-merge-one-file.sh
  108. git-merge-ours.sh
  109. git-merge-recursive.py
  110. git-merge-resolve.sh
  111. git-merge-stupid.sh
  112. git-merge.sh
  113. git-mv.perl
  114. git-p4import.py
  115. git-parse-remote.sh
  116. git-prune.sh
  117. git-pull.sh
  118. git-push.sh
  119. git-quiltimport.sh
  120. git-rebase.sh
  121. git-relink.perl
  122. git-repack.sh
  123. git-request-pull.sh
  124. git-rerere.perl
  125. git-reset.sh
  126. git-resolve.sh
  127. git-revert.sh
  128. git-send-email.perl
  129. git-sh-setup.sh
  130. git-shortlog.perl
  131. git-svnimport.perl
  132. git-tag.sh
  133. git-verify-tag.sh
  134. GIT-VERSION-GEN
  135. git.c
  136. git.spec.in
  137. gitk
  138. gitMergeCommon.py
  139. hash-object.c
  140. http-fetch.c
  141. http-push.c
  142. http.c
  143. http.h
  144. ident.c
  145. imap-send.c
  146. index-pack.c
  147. INSTALL
  148. local-fetch.c
  149. lockfile.c
  150. log-tree.c
  151. log-tree.h
  152. mailinfo.c
  153. mailsplit.c
  154. Makefile
  155. merge-base.c
  156. merge-index.c
  157. merge-tree.c
  158. mktag.c
  159. mktree.c
  160. name-rev.c
  161. object-refs.c
  162. object.c
  163. object.h
  164. pack-check.c
  165. pack-objects.c
  166. pack-redundant.c
  167. pack.h
  168. pager.c
  169. patch-delta.c
  170. patch-id.c
  171. path.c
  172. peek-remote.c
  173. pkt-line.c
  174. pkt-line.h
  175. prune-packed.c
  176. quote.c
  177. quote.h
  178. read-cache.c
  179. README
  180. receive-pack.c
  181. refs.c
  182. refs.h
  183. repo-config.c
  184. revision.c
  185. revision.h
  186. rsh.c
  187. rsh.h
  188. run-command.c
  189. run-command.h
  190. send-pack.c
  191. server-info.c
  192. setup.c
  193. sha1_file.c
  194. sha1_name.c
  195. shell.c
  196. show-index.c
  197. ssh-fetch.c
  198. ssh-pull.c
  199. ssh-push.c
  200. ssh-upload.c
  201. strbuf.c
  202. strbuf.h
  203. stripspace.c
  204. symbolic-ref.c
  205. tag.c
  206. tag.h
  207. tar.h
  208. test-date.c
  209. test-delta.c
  210. tree-diff.c
  211. tree-walk.c
  212. tree-walk.h
  213. tree.c
  214. tree.h
  215. unpack-file.c
  216. unpack-objects.c
  217. update-index.c
  218. update-ref.c
  219. update-server-info.c
  220. upload-pack.c
  221. usage.c
  222. var.c
  223. verify-pack.c
  224. write-tree.c
  225. xdiff-interface.c
  226. xdiff-interface.h