Teach core object handling functions about gitlinks

This teaches the really fundamental core SHA1 object handling routines
about gitlinks.  We can compare trees with gitlinks in them (although we
can not actually generate patches for them yet - just raw git diffs),
and they show up as commits in "git ls-tree".

We also know to compare gitlinks as if they were directories (ie the
normal "sort as trees" rules apply).

[jc: amended a cut&paste error]

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