Libify the index refresh logic

This cleans up and libifies the "git update-index --[really-]refresh"
functionality. This will be eventually required for eventually doing the
"commit" and "status" commands as built-ins.

It really just moves "refresh_index()" from update-index.c to
read-cache.c, but it also has to change the calling convention so that the
function uses a "unsigned int flags" argument instead of various static
flags variables for passing down the information about whether to be quiet
or not, and allow unmerged entries etc.

That actually cleans up update-index.c too, since it turns out that all
those flags were really specific to that one function of the index update,
so they shouldn't have had file-scope visibility even before.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
3 files changed
tree: 0e211548f57590d05eab3d266584c7cad26794bc
  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-rebase.sh
  106. git-relink.perl
  107. git-repack.sh
  108. git-request-pull.sh
  109. git-rerere.perl
  110. git-reset.sh
  111. git-resolve.sh
  112. git-revert.sh
  113. git-rm.sh
  114. git-send-email.perl
  115. git-sh-setup.sh
  116. git-shortlog.perl
  117. git-svnimport.perl
  118. git-tag.sh
  119. git-verify-tag.sh
  120. GIT-VERSION-GEN
  121. git.c
  122. git.spec.in
  123. gitk
  124. gitMergeCommon.py
  125. hash-object.c
  126. http-fetch.c
  127. http-push.c
  128. http.c
  129. http.h
  130. ident.c
  131. imap-send.c
  132. index-pack.c
  133. index.c
  134. INSTALL
  135. local-fetch.c
  136. log-tree.c
  137. log-tree.h
  138. ls-files.c
  139. ls-tree.c
  140. mailinfo.c
  141. mailsplit.c
  142. Makefile
  143. merge-base.c
  144. merge-index.c
  145. merge-tree.c
  146. mktag.c
  147. mktree.c
  148. name-rev.c
  149. object.c
  150. object.h
  151. pack-check.c
  152. pack-objects.c
  153. pack-redundant.c
  154. pack.h
  155. pager.c
  156. patch-delta.c
  157. patch-id.c
  158. path.c
  159. peek-remote.c
  160. pkt-line.c
  161. pkt-line.h
  162. prune-packed.c
  163. quote.c
  164. quote.h
  165. read-cache.c
  166. read-tree.c
  167. README
  168. receive-pack.c
  169. refs.c
  170. refs.h
  171. repo-config.c
  172. rev-parse.c
  173. revision.c
  174. revision.h
  175. rsh.c
  176. rsh.h
  177. run-command.c
  178. run-command.h
  179. send-pack.c
  180. server-info.c
  181. setup.c
  182. sha1_file.c
  183. sha1_name.c
  184. shell.c
  185. show-branch.c
  186. show-index.c
  187. ssh-fetch.c
  188. ssh-pull.c
  189. ssh-push.c
  190. ssh-upload.c
  191. strbuf.c
  192. strbuf.h
  193. stripspace.c
  194. symbolic-ref.c
  195. tag.c
  196. tag.h
  197. tar-tree.c
  198. tar.h
  199. test-date.c
  200. test-delta.c
  201. tree-diff.c
  202. tree-walk.c
  203. tree-walk.h
  204. tree.c
  205. tree.h
  206. unpack-file.c
  207. unpack-objects.c
  208. update-index.c
  209. update-ref.c
  210. update-server-info.c
  211. upload-pack.c
  212. usage.c
  213. var.c
  214. verify-pack.c
  215. write-tree.c
  216. xdiff-interface.c
  217. xdiff-interface.h