apply: force matching at the beginning.

When there is no leading context, the patch must match at the
beginning of preimage; otherwise there is a "patch adds these
lines while the other lines were added to the original file"
conflict.

This is the opposite of match_end fix earlier in this series.
Unlike matching at the end case, we can additionally check the
preimage line number recorded in the patch, so the change is not
symmetrical with the earlier one.

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