Convert memcpy(a,b,20) to hashcpy(a,b).

This abstracts away the size of the hash values when copying them
from memory location to memory location, much as the introduction
of hashcmp abstracted away hash value comparsion.

A few call sites were using char* rather than unsigned char* so
I added the cast rather than open hashcpy to be void*.  This is a
reasonable tradeoff as most call sites already use unsigned char*
and the existing hashcmp is also declared to be unsigned char*.

[jc: Splitted the patch to "master" part, to be followed by a
 patch for merge-recursive.c which is not in "master" yet.

 Fixed the cast in the latter hunk to combine-diff.c which was
 wrong in the original.

 Also converted ones left-over in combine-diff.c, diff-lib.c and
 upload-pack.c ]

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