read-cache*.h: move declarations for read-cache.c functions from cache.h

For the functions defined in read-cache.c, move their declarations from
cache.h to a new header, read-cache-ll.h.  Also move some related inline
functions from cache.h to read-cache.h.  The purpose of the
read-cache-ll.h/read-cache.h split is that about 70% of the sites don't
need the inline functions and the extra headers they include.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/builtin/add.c b/builtin/add.c
index 8397be4..9fe6b6c 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -20,6 +20,7 @@
 #include "preload-index.h"
 #include "diff.h"
 #include "diffcore.h"
+#include "read-cache.h"
 #include "revision.h"
 #include "bulk-checkin.h"
 #include "strvec.h"
diff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c
index 2120dd1..c655dc4 100644
--- a/builtin/checkout--worker.c
+++ b/builtin/checkout--worker.c
@@ -6,6 +6,7 @@
 #include "parallel-checkout.h"
 #include "parse-options.h"
 #include "pkt-line.h"
+#include "read-cache-ll.h"
 
 static void packet_to_pc_item(const char *buffer, int len,
 			      struct parallel_checkout_item *pc_item)
diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c
index b1cd8be..f62f13f 100644
--- a/builtin/checkout-index.c
+++ b/builtin/checkout-index.c
@@ -16,6 +16,7 @@
 #include "parse-options.h"
 #include "entry.h"
 #include "parallel-checkout.h"
+#include "read-cache-ll.h"
 #include "setup.h"
 #include "sparse-index.h"
 
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 2d72a74..09b8415 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -21,6 +21,7 @@
 #include "object-store.h"
 #include "parse-options.h"
 #include "preload-index.h"
+#include "read-cache.h"
 #include "refs.h"
 #include "remote.h"
 #include "resolve-undo.h"
diff --git a/builtin/clean.c b/builtin/clean.c
index 78852d2..49c7af4 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -14,6 +14,7 @@
 #include "dir.h"
 #include "gettext.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "string-list.h"
diff --git a/builtin/commit.c b/builtin/commit.c
index 877955e..829daac 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -31,6 +31,7 @@
 #include "object-name.h"
 #include "parse-options.h"
 #include "preload-index.h"
+#include "read-cache.h"
 #include "string-list.h"
 #include "rerere.h"
 #include "unpack-trees.h"
diff --git a/builtin/describe.c b/builtin/describe.c
index 55b4baa..f1be7c3 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -13,6 +13,7 @@
 #include "exec-cmd.h"
 #include "object-name.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
 #include "revision.h"
 #include "diff.h"
 #include "hashmap.h"
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index c054031..8f7dff8 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -8,6 +8,7 @@
 #include "log-tree.h"
 #include "builtin.h"
 #include "submodule.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "tree.h"
 
diff --git a/builtin/diff.c b/builtin/diff.c
index 9675507..a9ce701 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -17,6 +17,7 @@
 #include "diff-merges.h"
 #include "diffcore.h"
 #include "preload-index.h"
+#include "read-cache-ll.h"
 #include "revision.h"
 #include "log-tree.h"
 #include "builtin.h"
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 2c27a59..8880997 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -23,6 +23,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
 #include "sparse-index.h"
 #include "strvec.h"
 #include "strbuf.h"
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 712e3dc..d4e04bb 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -22,6 +22,7 @@
 #include "object-file.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "read-cache-ll.h"
 #include "replace-object.h"
 #include "resolve-undo.h"
 #include "run-command.h"
diff --git a/builtin/grep.c b/builtin/grep.c
index b86c754..0d56757 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -31,6 +31,7 @@
 #include "object-store.h"
 #include "packfile.h"
 #include "pager.h"
+#include "read-cache-ll.h"
 #include "write-or-die.h"
 
 static const char *grep_prefix;
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index b623896..a0bea8f 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -21,6 +21,7 @@
 #include "resolve-undo.h"
 #include "string-list.h"
 #include "pathspec.h"
+#include "read-cache.h"
 #include "run-command.h"
 #include "setup.h"
 #include "sparse-index.h"
diff --git a/builtin/merge-index.c b/builtin/merge-index.c
index d16e8aa..270d5f6 100644
--- a/builtin/merge-index.c
+++ b/builtin/merge-index.c
@@ -1,6 +1,7 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
 #include "hex.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "run-command.h"
 #include "sparse-index.h"
diff --git a/builtin/mv.c b/builtin/mv.c
index e058b57..ae462bd 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -19,6 +19,7 @@
 #include "cache-tree.h"
 #include "string-list.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "submodule.h"
diff --git a/builtin/pull.c b/builtin/pull.c
index eb60c9d..3052244 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -20,6 +20,7 @@
 #include "oid-array.h"
 #include "remote.h"
 #include "dir.h"
+#include "read-cache-ll.h"
 #include "rebase.h"
 #include "refs.h"
 #include "refspec.h"
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 852e49e..ad93e5f 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -18,6 +18,7 @@
 #include "object-name.h"
 #include "parse-options.h"
 #include "diff.h"
+#include "read-cache-ll.h"
 #include "revision.h"
 #include "setup.h"
 #include "split-index.h"
diff --git a/builtin/rm.c b/builtin/rm.c
index 377a0f6..463eeab 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -16,6 +16,7 @@
 #include "tree-walk.h"
 #include "object-name.h"
 #include "parse-options.h"
+#include "read-cache.h"
 #include "repository.h"
 #include "string-list.h"
 #include "setup.h"
diff --git a/builtin/stash.c b/builtin/stash.c
index 06527ee..d3d5bb9 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -18,6 +18,7 @@
 #include "dir.h"
 #include "entry.h"
 #include "preload-index.h"
+#include "read-cache.h"
 #include "rerere.h"
 #include "revision.h"
 #include "setup.h"
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 7b201d7..02f295e 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -13,6 +13,7 @@
 #include "pathspec.h"
 #include "preload-index.h"
 #include "dir.h"
+#include "read-cache.h"
 #include "setup.h"
 #include "sparse-index.h"
 #include "submodule.h"
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 47dc9b6..484a307 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -22,6 +22,7 @@
 #include "parse-options.h"
 #include "pathspec.h"
 #include "dir.h"
+#include "read-cache.h"
 #include "repository.h"
 #include "setup.h"
 #include "sparse-index.h"
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 60e389a..efe520f 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -13,6 +13,7 @@
 #include "parse-options.h"
 #include "strvec.h"
 #include "branch.h"
+#include "read-cache-ll.h"
 #include "refs.h"
 #include "repository.h"
 #include "run-command.h"