cvsimport: move over to using git-for-each-ref to read refs.

cvsimport opens all of the files in $GIT_DIR/refs/heads and reads
out the sha1's in order to work out what time the last commit on
that branch was made (in CVS) thus allowing incremental updates.
However, this takes no account of hierachical refs naming producing
the following error for each directory in $GIT_DIR/refs:

  Use of uninitialized value in chomp at /usr/bin/git-cvsimport line 503.
  Use of uninitialized value in concatenation (.) or string at
					/usr/bin/git-cvsimport line 505.
  usage: git-cat-file [-t|-s|-e|-p|<type>] <sha1>

Take advantage of the new packed refs work to use the new
for-each-ref iterator to get this information.

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