object-store: move object access functions to object-store.h

This should make these functions easier to find and cache.h less overwhelming to read. In particular, this moves: - read_object_file - oid_object_info - write_object_file As a result, most of the codebase needs to #include object-store.h. In this patch the #include is only added to files that would fail to compile otherwise. It would be better to #include wherever identifiers from the header are used. That can happen later when we have better tooling for it. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed May 15, 2018 at 16:42 UTC cbd53a2193d11e83b5bad2c3514bd1603074bc36
79 files changed +198 -117
apply.c
+1
@@ -9,6 +9,7 @@
9
10 #include "cache.h"
11 #include "config.h"
12 +#include "object-store.h"
13 #include "blob.h"
14 #include "delta.h"
15 #include "diff.h"
archive-tar.c
+1
@@ -5,6 +5,7 @@
5 #include "config.h"
6 #include "tar.h"
7 #include "archive.h"
8 +#include "object-store.h"
9 #include "streaming.h"
10 #include "run-command.h"
11
archive-zip.c
+1
@@ -6,6 +6,7 @@
6 #include "archive.h"
7 #include "streaming.h"
8 #include "utf8.h"
9 +#include "object-store.h"
10 #include "userdiff.h"
11 #include "xdiff-interface.h"
12
archive.c
+1
@@ -1,6 +1,7 @@
1 #include "cache.h"
2 #include "config.h"
3 #include "refs.h"
4 +#include "object-store.h"
5 #include "commit.h"
6 #include "tree-walk.h"
7 #include "attr.h"
blame.c
+1
@@ -1,5 +1,6 @@
1 #include "cache.h"
2 #include "refs.h"
3 +#include "object-store.h"
4 #include "cache-tree.h"
5 #include "mergesort.h"
6 #include "diff.h"
builtin/blame.c
+1
@@ -22,6 +22,7 @@
22 #include "line-log.h"
23 #include "dir.h"
24 #include "progress.h"
25 +#include "object-store.h"
26 #include "blame.h"
27
28 static char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>");
builtin/cat-file.c
+1
@@ -13,6 +13,7 @@
13 #include "tree-walk.h"
14 #include "sha1-array.h"
15 #include "packfile.h"
16 +#include "object-store.h"
17
18 struct batch_options {
19 int enabled;
builtin/checkout.c
+1
@@ -4,6 +4,7 @@
4 #include "lockfile.h"
5 #include "parse-options.h"
6 #include "refs.h"
7 +#include "object-store.h"
8 #include "commit.h"
9 #include "tree.h"
10 #include "tree-walk.h"
builtin/clone.c
+1
@@ -14,6 +14,7 @@
14 #include "parse-options.h"
15 #include "fetch-pack.h"
16 #include "refs.h"
17 +#include "object-store.h"
18 #include "tree.h"
19 #include "tree-walk.h"
20 #include "unpack-trees.h"
builtin/commit-tree.c
+1
@@ -5,6 +5,7 @@
5 */
6 #include "cache.h"
7 #include "config.h"
8 +#include "object-store.h"
9 #include "commit.h"
10 #include "tree.h"
11 #include "builtin.h"
builtin/describe.c
+1
@@ -13,6 +13,7 @@
13 #include "hashmap.h"
14 #include "argv-array.h"
15 #include "run-command.h"
16 +#include "object-store.h"
17 #include "revision.h"
18 #include "list-objects.h"
19
builtin/difftool.c
+1
@@ -20,6 +20,7 @@
20 #include "argv-array.h"
21 #include "strbuf.h"
22 #include "lockfile.h"
23 +#include "object-store.h"
24 #include "dir.h"
25
26 static char *diff_gui_tool;
builtin/fast-export.c
+1
@@ -7,6 +7,7 @@
7 #include "cache.h"
8 #include "config.h"
9 #include "refs.h"
10 +#include "object-store.h"
11 #include "commit.h"
12 #include "object.h"
13 #include "tag.h"
builtin/fetch.c
+1
@@ -5,6 +5,7 @@
5 #include "config.h"
6 #include "repository.h"
7 #include "refs.h"
8 +#include "object-store.h"
9 #include "commit.h"
10 #include "builtin.h"
11 #include "string-list.h"
builtin/fmt-merge-msg.c
+1
@@ -2,6 +2,7 @@
2 #include "cache.h"
3 #include "config.h"
4 #include "refs.h"
5 +#include "object-store.h"
6 #include "commit.h"
7 #include "diff.h"
8 #include "revision.h"
builtin/hash-object.c
+1
@@ -6,6 +6,7 @@
6 */
7 #include "builtin.h"
8 #include "config.h"
9 +#include "object-store.h"
10 #include "blob.h"
11 #include "quote.h"
12 #include "parse-options.h"
builtin/log.c
+1
@@ -7,6 +7,7 @@
7 #include "cache.h"
8 #include "config.h"
9 #include "refs.h"
10 +#include "object-store.h"
11 #include "color.h"
12 #include "commit.h"
13 #include "diff.h"
builtin/ls-tree.c
+1
@@ -5,6 +5,7 @@
5 */
6 #include "cache.h"
7 #include "config.h"
8 +#include "object-store.h"
9 #include "blob.h"
10 #include "tree.h"
11 #include "commit.h"
builtin/merge-tree.c
+1
@@ -1,6 +1,7 @@
1 #include "builtin.h"
2 #include "tree-walk.h"
3 #include "xdiff-interface.h"
4 +#include "object-store.h"
5 #include "blob.h"
6 #include "exec_cmd.h"
7 #include "merge-blobs.h"
builtin/mktag.c
+1
@@ -1,6 +1,7 @@
1 #include "builtin.h"
2 #include "tag.h"
3 #include "replace-object.h"
4 +#include "object-store.h"
5
6 /*
7 * A signature file has a very simple fixed format: four lines
builtin/mktree.c
+1
@@ -7,6 +7,7 @@
7 #include "quote.h"
8 #include "tree.h"
9 #include "parse-options.h"
10 +#include "object-store.h"
11
12 static struct treeent {
13 unsigned mode;
builtin/notes.c
+1
@@ -11,6 +11,7 @@
11 #include "config.h"
12 #include "builtin.h"
13 #include "notes.h"
14 +#include "object-store.h"
15 #include "blob.h"
16 #include "pretty.h"
17 #include "refs.h"
builtin/prune.c
+1
@@ -6,6 +6,7 @@
6 #include "reachable.h"
7 #include "parse-options.h"
8 #include "progress.h"
9 +#include "object-store.h"
10
11 static const char * const prune_usage[] = {
12 N_("git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"),
builtin/receive-pack.c
+1
@@ -25,6 +25,7 @@
25 #include "tmp-objdir.h"
26 #include "oidset.h"
27 #include "packfile.h"
28 +#include "object-store.h"
29 #include "protocol.h"
30
31 static const char * const receive_pack_usage[] = {
builtin/reflog.c
+1
@@ -1,6 +1,7 @@
1 #include "builtin.h"
2 #include "config.h"
3 #include "lockfile.h"
4 +#include "object-store.h"
5 #include "commit.h"
6 #include "refs.h"
7 #include "dir.h"
builtin/remote.c
+1
@@ -7,6 +7,7 @@
7 #include "strbuf.h"
8 #include "run-command.h"
9 #include "refs.h"
10 +#include "object-store.h"
11 #include "argv-array.h"
12
13 static const char * const builtin_remote_usage[] = {
builtin/rev-list.c
+1
@@ -6,6 +6,7 @@
6 #include "list-objects.h"
7 #include "list-objects-filter.h"
8 #include "list-objects-filter-options.h"
9 +#include "object-store.h"
10 #include "pack.h"
11 #include "pack-bitmap.h"
12 #include "builtin.h"
builtin/show-ref.c
+1
@@ -1,6 +1,7 @@
1 #include "builtin.h"
2 #include "cache.h"
3 #include "refs.h"
4 +#include "object-store.h"
5 #include "object.h"
6 #include "tag.h"
7 #include "string-list.h"
builtin/tag.c
+1
@@ -10,6 +10,7 @@
10 #include "config.h"
11 #include "builtin.h"
12 #include "refs.h"
13 +#include "object-store.h"
14 #include "tag.h"
15 #include "run-command.h"
16 #include "parse-options.h"
builtin/unpack-file.c
+1
@@ -1,5 +1,6 @@
1 #include "builtin.h"
2 #include "config.h"
3 +#include "object-store.h"
4
5 static char *create_temp_file(struct object_id *oid)
6 {
builtin/unpack-objects.c
+1
@@ -1,6 +1,7 @@
1 #include "builtin.h"
2 #include "cache.h"
3 #include "config.h"
4 +#include "object-store.h"
5 #include "object.h"
6 #include "delta.h"
7 #include "pack.h"
builtin/verify-commit.c
+1
@@ -8,6 +8,7 @@
8 #include "cache.h"
9 #include "config.h"
10 #include "builtin.h"
11 +#include "object-store.h"
12 #include "commit.h"
13 #include "run-command.h"
14 #include <signal.h>
bulk-checkin.c
+1
@@ -8,6 +8,7 @@
8 #include "pack.h"
9 #include "strbuf.h"
10 #include "packfile.h"
11 +#include "object-store.h"
12
13 static struct bulk_checkin_state {
14 unsigned plugged:1;
bundle.c
+1
@@ -1,6 +1,7 @@
1 #include "cache.h"
2 #include "lockfile.h"
3 #include "bundle.h"
4 +#include "object-store.h"
5 #include "object.h"
6 #include "commit.h"
7 #include "diff.h"
cache-tree.c
+1
@@ -3,6 +3,7 @@
3 #include "tree.h"
4 #include "tree-walk.h"
5 #include "cache-tree.h"
6 +#include "object-store.h"
7
8 #ifndef DEBUG
9 #define DEBUG 0
cache.h
-117
@@ -1183,32 +1183,6 @@ extern char *xdg_config_home(const char *filename);
1183 */
1184 extern char *xdg_cache_home(const char *filename);
1185
1186 -extern void *read_object_file_extended(const struct object_id *oid,
1187 - enum object_type *type,
1188 - unsigned long *size, int lookup_replace);
1189 -static inline void *read_object_file(const struct object_id *oid, enum object_type *type, unsigned long *size)
1190 -{
1191 - return read_object_file_extended(oid, type, size, 1);
1192 -}
1193 -
1194 -/* Read and unpack an object file into memory, write memory to an object file */
1195 -int oid_object_info(struct repository *r, const struct object_id *, unsigned long *);
1196 -
1197 -extern int hash_object_file(const void *buf, unsigned long len,
1198 - const char *type, struct object_id *oid);
1199 -
1200 -extern int write_object_file(const void *buf, unsigned long len,
1201 - const char *type, struct object_id *oid);
1202 -
1203 -extern int hash_object_file_literally(const void *buf, unsigned long len,
1204 - const char *type, struct object_id *oid,
1205 - unsigned flags);
1206 -
1207 -extern int pretend_object_file(void *, unsigned long, enum object_type,
1208 - struct object_id *oid);
1209 -
1210 -extern int force_object_loose(const struct object_id *oid, time_t mtime);
1211 -
1186 extern int git_open_cloexec(const char *name, int flags);
1187 #define git_open(name) git_open_cloexec(name, O_RDONLY)
1188 extern int unpack_sha1_header(git_zstream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz);
@@ -1218,43 +1192,6 @@ extern int check_object_signature(const struct object_id *oid, void *buf, unsign
1192
1193 extern int finalize_object_file(const char *tmpfile, const char *filename);
1194
1221 -/*
1222 - * Open the loose object at path, check its hash, and return the contents,
1223 - * type, and size. If the object is a blob, then "contents" may return NULL,
1224 - * to allow streaming of large blobs.
1225 - *
1226 - * Returns 0 on success, negative on error (details may be written to stderr).
1227 - */
1228 -int read_loose_object(const char *path,
1229 - const struct object_id *expected_oid,
1230 - enum object_type *type,
1231 - unsigned long *size,
1232 - void **contents);
1233 -
1234 -/*
1235 - * Convenience for sha1_object_info_extended() with a NULL struct
1236 - * object_info. OBJECT_INFO_SKIP_CACHED is automatically set; pass
1237 - * nonzero flags to also set other flags.
1238 - */
1239 -extern int has_sha1_file_with_flags(const unsigned char *sha1, int flags);
1240 -static inline int has_sha1_file(const unsigned char *sha1)
1241 -{
1242 - return has_sha1_file_with_flags(sha1, 0);
1243 -}
1244 -
1245 -/* Same as the above, except for struct object_id. */
1246 -extern int has_object_file(const struct object_id *oid);
1247 -extern int has_object_file_with_flags(const struct object_id *oid, int flags);
1248 -
1249 -/*
1250 - * Return true iff an alternate object database has a loose object
1251 - * with the specified name. This function does not respect replace
1252 - * references.
1253 - */
1254 -extern int has_loose_object_nonlocal(const unsigned char *sha1);
1255 -
1256 -extern void assert_oid_type(const struct object_id *oid, enum object_type expect);
1257 -
1195 /* Helper to check and "touch" a file */
1196 extern int check_and_freshen_file(const char *fn, int freshen);
1197
@@ -1624,60 +1561,6 @@ int for_each_loose_file_in_objdir_buf(struct strbuf *path,
1561 #define FOR_EACH_OBJECT_LOCAL_ONLY 0x1
1562 extern int for_each_loose_object(each_loose_object_fn, void *, unsigned flags);
1563
1627 -struct object_info {
1628 - /* Request */
1629 - enum object_type *typep;
1630 - unsigned long *sizep;
1631 - off_t *disk_sizep;
1632 - unsigned char *delta_base_sha1;
1633 - struct strbuf *type_name;
1634 - void **contentp;
1635 -
1636 - /* Response */
1637 - enum {
1638 - OI_CACHED,
1639 - OI_LOOSE,
1640 - OI_PACKED,
1641 - OI_DBCACHED
1642 - } whence;
1643 - union {
1644 - /*
1645 - * struct {
1646 - * ... Nothing to expose in this case
1647 - * } cached;
1648 - * struct {
1649 - * ... Nothing to expose in this case
1650 - * } loose;
1651 - */
1652 - struct {
1653 - struct packed_git *pack;
1654 - off_t offset;
1655 - unsigned int is_delta;
1656 - } packed;
1657 - } u;
1658 -};
1659 -
1660 -/*
1661 - * Initializer for a "struct object_info" that wants no items. You may
1662 - * also memset() the memory to all-zeroes.
1663 - */
1664 -#define OBJECT_INFO_INIT {NULL}
1665 -
1666 -/* Invoke lookup_replace_object() on the given hash */
1667 -#define OBJECT_INFO_LOOKUP_REPLACE 1
1668 -/* Allow reading from a loose object file of unknown/bogus type */
1669 -#define OBJECT_INFO_ALLOW_UNKNOWN_TYPE 2
1670 -/* Do not check cached storage */
1671 -#define OBJECT_INFO_SKIP_CACHED 4
1672 -/* Do not retry packed storage after checking packed and loose storage */
1673 -#define OBJECT_INFO_QUICK 8
1674 -/* Do not check loose object */
1675 -#define OBJECT_INFO_IGNORE_LOOSE 16
1676 -
1677 -int oid_object_info_extended(struct repository *r,
1678 - const struct object_id *,
1679 - struct object_info *, unsigned flags);
1680 -
1564 /*
1565 * Set this to 0 to prevent sha1_object_info_extended() from fetching missing
1566 * blobs. This has a difference only if extensions.partialClone is set.
combine-diff.c
+1
@@ -1,4 +1,5 @@
1 #include "cache.h"
2 +#include "object-store.h"
3 #include "commit.h"
4 #include "blob.h"
5 #include "diff.h"
commit.c
+1
@@ -1,6 +1,7 @@
1 #include "cache.h"
2 #include "tag.h"
3 #include "commit.h"
4 +#include "object-store.h"
5 #include "pkt-line.h"
6 #include "utf8.h"
7 #include "diff.h"
config.c
+1
@@ -14,6 +14,7 @@
14 #include "quote.h"
15 #include "hashmap.h"
16 #include "string-list.h"
17 +#include "object-store.h"
18 #include "utf8.h"
19 #include "dir.h"
20
convert.c
+1
@@ -1,6 +1,7 @@
1 #define NO_THE_INDEX_COMPATIBILITY_MACROS
2 #include "cache.h"
3 #include "config.h"
4 +#include "object-store.h"
5 #include "attr.h"
6 #include "run-command.h"
7 #include "quote.h"
diff.c
+1
@@ -13,6 +13,7 @@
13 #include "attr.h"
14 #include "run-command.h"
15 #include "utf8.h"
16 +#include "object-store.h"
17 #include "userdiff.h"
18 #include "submodule-config.h"
19 #include "submodule.h"
diffcore-rename.c
+1
@@ -4,6 +4,7 @@
4 #include "cache.h"
5 #include "diff.h"
6 #include "diffcore.h"
7 +#include "object-store.h"
8 #include "hashmap.h"
9 #include "progress.h"
10
dir.c
+1
@@ -11,6 +11,7 @@
11 #include "cache.h"
12 #include "config.h"
13 #include "dir.h"
14 +#include "object-store.h"
15 #include "attr.h"
16 #include "refs.h"
17 #include "wildmatch.h"
entry.c
+1
@@ -1,5 +1,6 @@
1 #include "cache.h"
2 #include "blob.h"
3 +#include "object-store.h"
4 #include "dir.h"
5 #include "streaming.h"
6 #include "submodule.h"
fetch-pack.c
+1
@@ -19,6 +19,7 @@
19 #include "sha1-array.h"
20 #include "oidset.h"
21 #include "packfile.h"
22 +#include "object-store.h"
23
24 static int transfer_unpack_limit = -1;
25 static int fetch_unpack_limit = -1;
fsck.c
+1
@@ -1,4 +1,5 @@
1 #include "cache.h"
2 +#include "object-store.h"
3 #include "object.h"
4 #include "blob.h"
5 #include "tree.h"
grep.c
+1
@@ -1,6 +1,7 @@
1 #include "cache.h"
2 #include "config.h"
3 #include "grep.h"
4 +#include "object-store.h"
5 #include "userdiff.h"
6 #include "xdiff-interface.h"
7 #include "diff.h"
list-objects-filter.c
+1
@@ -11,6 +11,7 @@
11 #include "list-objects-filter.h"
12 #include "list-objects-filter-options.h"
13 #include "oidset.h"
14 +#include "object-store.h"
15
16 /* Remember to update object flag allocation in object.h */
17 /*
list-objects.c
+1
@@ -10,6 +10,7 @@
10 #include "list-objects-filter.h"
11 #include "list-objects-filter-options.h"
12 #include "packfile.h"
13 +#include "object-store.h"
14
15 static void process_blob(struct rev_info *revs,
16 struct blob *blob,
log-tree.c
+1
@@ -1,6 +1,7 @@
1 #include "cache.h"
2 #include "config.h"
3 #include "diff.h"
4 +#include "object-store.h"
5 #include "commit.h"
6 #include "tag.h"
7 #include "graph.h"
mailmap.c
+1
@@ -1,6 +1,7 @@
1 #include "cache.h"
2 #include "string-list.h"
3 #include "mailmap.h"
4 +#include "object-store.h"
5
6 #define DEBUG_MAILMAP 0
7 #if DEBUG_MAILMAP
match-trees.c
+1
@@ -1,6 +1,7 @@
1 #include "cache.h"
2 #include "tree.h"
3 #include "tree-walk.h"
4 +#include "object-store.h"
5
6 static int score_missing(unsigned mode, const char *path)
7 {
merge-blobs.c
+1
@@ -4,6 +4,7 @@
4 #include "ll-merge.h"
5 #include "blob.h"
6 #include "merge-blobs.h"
7 +#include "object-store.h"
8
9 static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
10 {
merge-recursive.c
+1
@@ -8,6 +8,7 @@
8 #include "advice.h"
9 #include "lockfile.h"
10 #include "cache-tree.h"
11 +#include "object-store.h"
12 #include "commit.h"
13 #include "blob.h"
14 #include "builtin.h"
notes-cache.c
+1
@@ -1,5 +1,6 @@
1 #include "cache.h"
2 #include "notes-cache.h"
3 +#include "object-store.h"
4 #include "commit.h"
5 #include "refs.h"
6
notes-merge.c
+1
@@ -1,6 +1,7 @@
1 #include "cache.h"
2 #include "commit.h"
3 #include "refs.h"
4 +#include "object-store.h"
5 #include "diff.h"
6 #include "diffcore.h"
7 #include "xdiff-interface.h"
notes.c
+1
@@ -1,6 +1,7 @@
1 #include "cache.h"
2 #include "config.h"
3 #include "notes.h"
4 +#include "object-store.h"
5 #include "blob.h"
6 #include "tree.h"
7 #include "utf8.h"
object-store.h
+117
@@ -137,4 +137,121 @@ void sha1_file_name(struct repository *r, struct strbuf *buf, const unsigned cha
137
138 void *map_sha1_file(struct repository *r, const unsigned char *sha1, unsigned long *size);
139
140 +extern void *read_object_file_extended(const struct object_id *oid,
141 + enum object_type *type,
142 + unsigned long *size, int lookup_replace);
143 +static inline void *read_object_file(const struct object_id *oid, enum object_type *type, unsigned long *size)
144 +{
145 + return read_object_file_extended(oid, type, size, 1);
146 +}
147 +
148 +/* Read and unpack an object file into memory, write memory to an object file */
149 +int oid_object_info(struct repository *r, const struct object_id *, unsigned long *);
150 +
151 +extern int hash_object_file(const void *buf, unsigned long len,
152 + const char *type, struct object_id *oid);
153 +
154 +extern int write_object_file(const void *buf, unsigned long len,
155 + const char *type, struct object_id *oid);
156 +
157 +extern int hash_object_file_literally(const void *buf, unsigned long len,
158 + const char *type, struct object_id *oid,
159 + unsigned flags);
160 +
161 +extern int pretend_object_file(void *, unsigned long, enum object_type,
162 + struct object_id *oid);
163 +
164 +extern int force_object_loose(const struct object_id *oid, time_t mtime);
165 +
166 +/*
167 + * Open the loose object at path, check its hash, and return the contents,
168 + * type, and size. If the object is a blob, then "contents" may return NULL,
169 + * to allow streaming of large blobs.
170 + *
171 + * Returns 0 on success, negative on error (details may be written to stderr).
172 + */
173 +int read_loose_object(const char *path,
174 + const struct object_id *expected_oid,
175 + enum object_type *type,
176 + unsigned long *size,
177 + void **contents);
178 +
179 +/*
180 + * Convenience for sha1_object_info_extended() with a NULL struct
181 + * object_info. OBJECT_INFO_SKIP_CACHED is automatically set; pass
182 + * nonzero flags to also set other flags.
183 + */
184 +extern int has_sha1_file_with_flags(const unsigned char *sha1, int flags);
185 +static inline int has_sha1_file(const unsigned char *sha1)
186 +{
187 + return has_sha1_file_with_flags(sha1, 0);
188 +}
189 +
190 +/* Same as the above, except for struct object_id. */
191 +extern int has_object_file(const struct object_id *oid);
192 +extern int has_object_file_with_flags(const struct object_id *oid, int flags);
193 +
194 +/*
195 + * Return true iff an alternate object database has a loose object
196 + * with the specified name. This function does not respect replace
197 + * references.
198 + */
199 +extern int has_loose_object_nonlocal(const unsigned char *sha1);
200 +
201 +extern void assert_oid_type(const struct object_id *oid, enum object_type expect);
202 +
203 +struct object_info {
204 + /* Request */
205 + enum object_type *typep;
206 + unsigned long *sizep;
207 + off_t *disk_sizep;
208 + unsigned char *delta_base_sha1;
209 + struct strbuf *type_name;
210 + void **contentp;
211 +
212 + /* Response */
213 + enum {
214 + OI_CACHED,
215 + OI_LOOSE,
216 + OI_PACKED,
217 + OI_DBCACHED
218 + } whence;
219 + union {
220 + /*
221 + * struct {
222 + * ... Nothing to expose in this case
223 + * } cached;
224 + * struct {
225 + * ... Nothing to expose in this case
226 + * } loose;
227 + */
228 + struct {
229 + struct packed_git *pack;
230 + off_t offset;
231 + unsigned int is_delta;
232 + } packed;
233 + } u;
234 +};
235 +
236 +/*
237 + * Initializer for a "struct object_info" that wants no items. You may
238 + * also memset() the memory to all-zeroes.
239 + */
240 +#define OBJECT_INFO_INIT {NULL}
241 +
242 +/* Invoke lookup_replace_object() on the given hash */
243 +#define OBJECT_INFO_LOOKUP_REPLACE 1
244 +/* Allow reading from a loose object file of unknown/bogus type */
245 +#define OBJECT_INFO_ALLOW_UNKNOWN_TYPE 2
246 +/* Do not check cached storage */
247 +#define OBJECT_INFO_SKIP_CACHED 4
248 +/* Do not retry packed storage after checking packed and loose storage */
249 +#define OBJECT_INFO_QUICK 8
250 +/* Do not check loose object */
251 +#define OBJECT_INFO_IGNORE_LOOSE 16
252 +
253 +int oid_object_info_extended(struct repository *r,
254 + const struct object_id *,
255 + struct object_info *, unsigned flags);
256 +
257 #endif /* OBJECT_STORE_H */
object.c
+1
@@ -1,6 +1,7 @@
1 #include "cache.h"
2 #include "object.h"
3 #include "replace-object.h"
4 +#include "object-store.h"
5 #include "blob.h"
6 #include "tree.h"
7 #include "commit.h"
pack-bitmap-write.c
+1
@@ -1,4 +1,5 @@
1 #include "cache.h"
2 +#include "object-store.h"
3 #include "commit.h"
4 #include "tag.h"
5 #include "diff.h"
packfile.h
+5
@@ -3,6 +3,11 @@
3
4 #include "oidset.h"
5
6 +/* in object-store.h */
7 +struct packed_git;
8 +struct object_info;
9 +enum object_type;
10 +
11 /*
12 * Generate the filename to be used for a pack file with checksum "sha1" and
13 * extension "ext". The result is written into the strbuf "buf", overwriting
read-cache.c
+1
@@ -11,6 +11,7 @@
11 #include "cache-tree.h"
12 #include "refs.h"
13 #include "dir.h"
14 +#include "object-store.h"
15 #include "tree.h"
16 #include "commit.h"
17 #include "blob.h"
ref-filter.c
+1
@@ -3,6 +3,7 @@
3 #include "parse-options.h"
4 #include "refs.h"
5 #include "wildmatch.h"
6 +#include "object-store.h"
7 #include "commit.h"
8 #include "remote.h"
9 #include "color.h"
refs.c
+1
@@ -9,6 +9,7 @@
9 #include "iterator.h"
10 #include "refs.h"
11 #include "refs/refs-internal.h"
12 +#include "object-store.h"
13 #include "object.h"
14 #include "tag.h"
15 #include "submodule.h"
remote-testsvn.c
+1
@@ -1,6 +1,7 @@
1 #include "cache.h"
2 #include "refs.h"
3 #include "remote.h"
4 +#include "object-store.h"
5 #include "strbuf.h"
6 #include "url.h"
7 #include "exec_cmd.h"
remote.c
+1
@@ -2,6 +2,7 @@
2 #include "config.h"
3 #include "remote.h"
4 #include "refs.h"
5 +#include "object-store.h"
6 #include "commit.h"
7 #include "diff.h"
8 #include "revision.h"
rerere.c
+1
@@ -9,6 +9,7 @@
9 #include "ll-merge.h"
10 #include "attr.h"
11 #include "pathspec.h"
12 +#include "object-store.h"
13 #include "sha1-lookup.h"
14
15 #define RESOLVED 0
revision.c
+1
@@ -1,4 +1,5 @@
1 #include "cache.h"
2 +#include "object-store.h"
3 #include "tag.h"
4 #include "blob.h"
5 #include "tree.h"
send-pack.c
+1
@@ -2,6 +2,7 @@
2 #include "config.h"
3 #include "commit.h"
4 #include "refs.h"
5 +#include "object-store.h"
6 #include "pkt-line.h"
7 #include "sideband.h"
8 #include "run-command.h"
sequencer.c
+1
@@ -2,6 +2,7 @@
2 #include "config.h"
3 #include "lockfile.h"
4 #include "dir.h"
5 +#include "object-store.h"
6 #include "object.h"
7 #include "commit.h"
8 #include "sequencer.h"
shallow.c
+1
@@ -1,6 +1,7 @@
1 #include "cache.h"
2 #include "tempfile.h"
3 #include "lockfile.h"
4 +#include "object-store.h"
5 #include "commit.h"
6 #include "tag.h"
7 #include "pkt-line.h"
submodule-config.c
+1
@@ -4,6 +4,7 @@
4 #include "submodule-config.h"
5 #include "submodule.h"
6 #include "strbuf.h"
7 +#include "object-store.h"
8 #include "parse-options.h"
9
10 /*
tag.c
+1
@@ -1,5 +1,6 @@
1 #include "cache.h"
2 #include "tag.h"
3 +#include "object-store.h"
4 #include "commit.h"
5 #include "tree.h"
6 #include "blob.h"
tree-walk.c
+1
@@ -2,6 +2,7 @@
2 #include "tree-walk.h"
3 #include "unpack-trees.h"
4 #include "dir.h"
5 +#include "object-store.h"
6 #include "tree.h"
7 #include "pathspec.h"
8
tree.c
+1
@@ -2,6 +2,7 @@
2 #include "cache.h"
3 #include "cache-tree.h"
4 #include "tree.h"
5 +#include "object-store.h"
6 #include "blob.h"
7 #include "commit.h"
8 #include "tag.h"
unpack-trees.c
+1
@@ -15,6 +15,7 @@
15 #include "submodule.h"
16 #include "submodule-config.h"
17 #include "fsmonitor.h"
18 +#include "object-store.h"
19 #include "fetch-object.h"
20
21 /*
upload-pack.c
+1
@@ -3,6 +3,7 @@
3 #include "refs.h"
4 #include "pkt-line.h"
5 #include "sideband.h"
6 +#include "object-store.h"
7 #include "tag.h"
8 #include "object.h"
9 #include "commit.h"
walker.c
+1
@@ -1,5 +1,6 @@
1 #include "cache.h"
2 #include "walker.h"
3 +#include "object-store.h"
4 #include "commit.h"
5 #include "tree.h"
6 #include "tree-walk.h"
xdiff-interface.c
+1
@@ -1,5 +1,6 @@
1 #include "cache.h"
2 #include "config.h"
3 +#include "object-store.h"
4 #include "xdiff-interface.h"
5 #include "xdiff/xtypes.h"
6 #include "xdiff/xdiffi.h"