Git fork

object-store-ll.h: split this header out of object-store.h

The vast majority of files including object-store.h did not need dir.h
nor khash.h. Split the header into two files, and let most just depend
upon object-store-ll.h, while letting the two callers that need it
depend on the full object-store.h.

After this patch:
$ git grep -h include..object-store | sort | uniq -c
2 #include "object-store.h"
129 #include "object-store-ll.h"

Diff best viewed with `--color-moved`.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Elijah Newren and committed by
Junio C Hamano
a034e910 8043418b

+677 -655
+1 -1
apply.c
··· 12 12 #include "alloc.h" 13 13 #include "base85.h" 14 14 #include "config.h" 15 - #include "object-store.h" 15 + #include "object-store-ll.h" 16 16 #include "blob.h" 17 17 #include "delta.h" 18 18 #include "diff.h"
+1 -1
archive-tar.c
··· 9 9 #include "hex.h" 10 10 #include "tar.h" 11 11 #include "archive.h" 12 - #include "object-store.h" 12 + #include "object-store-ll.h" 13 13 #include "streaming.h" 14 14 #include "run-command.h" 15 15 #include "write-or-die.h"
+1 -1
archive-zip.c
··· 9 9 #include "hex.h" 10 10 #include "streaming.h" 11 11 #include "utf8.h" 12 - #include "object-store.h" 12 + #include "object-store-ll.h" 13 13 #include "userdiff.h" 14 14 #include "write-or-die.h" 15 15 #include "xdiff-interface.h"
+1 -1
archive.c
··· 10 10 #include "pretty.h" 11 11 #include "setup.h" 12 12 #include "refs.h" 13 - #include "object-store.h" 13 + #include "object-store-ll.h" 14 14 #include "commit.h" 15 15 #include "tree.h" 16 16 #include "tree-walk.h"
+1 -1
attr.c
··· 19 19 #include "quote.h" 20 20 #include "read-cache-ll.h" 21 21 #include "revision.h" 22 - #include "object-store.h" 22 + #include "object-store-ll.h" 23 23 #include "setup.h" 24 24 #include "thread-utils.h" 25 25 #include "tree-walk.h"
+1 -1
bisect.c
··· 18 18 #include "commit-slab.h" 19 19 #include "commit-reach.h" 20 20 #include "object-name.h" 21 - #include "object-store.h" 21 + #include "object-store-ll.h" 22 22 #include "path.h" 23 23 #include "dir.h" 24 24
+1 -1
blame.c
··· 1 1 #include "git-compat-util.h" 2 2 #include "refs.h" 3 - #include "object-store.h" 3 + #include "object-store-ll.h" 4 4 #include "cache-tree.h" 5 5 #include "mergesort.h" 6 6 #include "convert.h"
+1 -1
builtin/blame.c
··· 29 29 #include "dir.h" 30 30 #include "progress.h" 31 31 #include "object-name.h" 32 - #include "object-store.h" 32 + #include "object-store-ll.h" 33 33 #include "pager.h" 34 34 #include "blame.h" 35 35 #include "refs.h"
+1 -1
builtin/cat-file.c
··· 21 21 #include "packfile.h" 22 22 #include "object-file.h" 23 23 #include "object-name.h" 24 - #include "object-store.h" 24 + #include "object-store-ll.h" 25 25 #include "replace-object.h" 26 26 #include "promisor-remote.h" 27 27 #include "mailmap.h"
+1 -1
builtin/checkout.c
··· 18 18 #include "mem-pool.h" 19 19 #include "merge-recursive.h" 20 20 #include "object-name.h" 21 - #include "object-store.h" 21 + #include "object-store-ll.h" 22 22 #include "parse-options.h" 23 23 #include "path.h" 24 24 #include "preload-index.h"
+1 -1
builtin/clone.c
··· 23 23 #include "refs.h" 24 24 #include "refspec.h" 25 25 #include "object-file.h" 26 - #include "object-store.h" 26 + #include "object-store-ll.h" 27 27 #include "tree.h" 28 28 #include "tree-walk.h" 29 29 #include "unpack-trees.h"
+1 -1
builtin/commit-graph.c
··· 9 9 #include "parse-options.h" 10 10 #include "repository.h" 11 11 #include "commit-graph.h" 12 - #include "object-store.h" 12 + #include "object-store-ll.h" 13 13 #include "progress.h" 14 14 #include "replace-object.h" 15 15 #include "tag.h"
+1 -1
builtin/commit-tree.c
··· 8 8 #include "gettext.h" 9 9 #include "hex.h" 10 10 #include "object-name.h" 11 - #include "object-store.h" 11 + #include "object-store-ll.h" 12 12 #include "repository.h" 13 13 #include "commit.h" 14 14 #include "tree.h"
+1 -1
builtin/count-objects.c
··· 14 14 #include "parse-options.h" 15 15 #include "quote.h" 16 16 #include "packfile.h" 17 - #include "object-store.h" 17 + #include "object-store-ll.h" 18 18 19 19 static unsigned long garbage; 20 20 static off_t size_garbage;
+1 -1
builtin/describe.c
··· 19 19 #include "setup.h" 20 20 #include "strvec.h" 21 21 #include "run-command.h" 22 - #include "object-store.h" 22 + #include "object-store-ll.h" 23 23 #include "list-objects.h" 24 24 #include "commit-slab.h" 25 25 #include "wildmatch.h"
+1 -1
builtin/difftool.c
··· 28 28 #include "strbuf.h" 29 29 #include "lockfile.h" 30 30 #include "object-file.h" 31 - #include "object-store.h" 31 + #include "object-store-ll.h" 32 32 #include "dir.h" 33 33 #include "entry.h" 34 34 #include "setup.h"
+1 -1
builtin/fast-export.c
··· 10 10 #include "refs.h" 11 11 #include "refspec.h" 12 12 #include "object-file.h" 13 - #include "object-store.h" 13 + #include "object-store-ll.h" 14 14 #include "commit.h" 15 15 #include "object.h" 16 16 #include "tag.h"
+1 -1
builtin/fast-import.c
··· 21 21 #include "packfile.h" 22 22 #include "object-file.h" 23 23 #include "object-name.h" 24 - #include "object-store.h" 24 + #include "object-store-ll.h" 25 25 #include "mem-pool.h" 26 26 #include "commit-reach.h" 27 27 #include "khash.h"
+1 -1
builtin/fetch.c
··· 11 11 #include "refs.h" 12 12 #include "refspec.h" 13 13 #include "object-name.h" 14 - #include "object-store.h" 14 + #include "object-store-ll.h" 15 15 #include "oidset.h" 16 16 #include "oid-array.h" 17 17 #include "commit.h"
+1 -1
builtin/fsck.c
··· 20 20 #include "packfile.h" 21 21 #include "object-file.h" 22 22 #include "object-name.h" 23 - #include "object-store.h" 23 + #include "object-store-ll.h" 24 24 #include "path.h" 25 25 #include "read-cache-ll.h" 26 26 #include "replace-object.h"
+1 -1
builtin/gc.c
··· 27 27 #include "commit-graph.h" 28 28 #include "packfile.h" 29 29 #include "object-file.h" 30 - #include "object-store.h" 30 + #include "object-store-ll.h" 31 31 #include "pack.h" 32 32 #include "pack-objects.h" 33 33 #include "path.h"
+1 -1
builtin/grep.c
··· 27 27 #include "submodule-config.h" 28 28 #include "object-file.h" 29 29 #include "object-name.h" 30 - #include "object-store.h" 30 + #include "object-store-ll.h" 31 31 #include "packfile.h" 32 32 #include "pager.h" 33 33 #include "path.h"
+2 -1
builtin/hash-object.c
··· 10 10 #include "gettext.h" 11 11 #include "hex.h" 12 12 #include "object-file.h" 13 - #include "object-store.h" 13 + #include "object-store-ll.h" 14 14 #include "blob.h" 15 15 #include "quote.h" 16 16 #include "parse-options.h" 17 17 #include "exec-cmd.h" 18 18 #include "setup.h" 19 + #include "strbuf.h" 19 20 #include "write-or-die.h" 20 21 21 22 /*
+2 -1
builtin/index-pack.c
··· 14 14 #include "progress.h" 15 15 #include "fsck.h" 16 16 #include "exec-cmd.h" 17 + #include "strbuf.h" 17 18 #include "streaming.h" 18 19 #include "thread-utils.h" 19 20 #include "packfile.h" 20 21 #include "pack-revindex.h" 21 22 #include "object-file.h" 22 - #include "object-store.h" 23 + #include "object-store-ll.h" 23 24 #include "oid-array.h" 24 25 #include "replace-object.h" 25 26 #include "promisor-remote.h"
+1 -1
builtin/log.c
··· 14 14 #include "refs.h" 15 15 #include "object-file.h" 16 16 #include "object-name.h" 17 - #include "object-store.h" 17 + #include "object-store-ll.h" 18 18 #include "pager.h" 19 19 #include "color.h" 20 20 #include "commit.h"
+1 -1
builtin/ls-tree.c
··· 8 8 #include "gettext.h" 9 9 #include "hex.h" 10 10 #include "object-name.h" 11 - #include "object-store.h" 11 + #include "object-store-ll.h" 12 12 #include "blob.h" 13 13 #include "tree.h" 14 14 #include "commit.h"
+1 -1
builtin/merge-tree.c
··· 9 9 #include "commit-reach.h" 10 10 #include "merge-ort.h" 11 11 #include "object-name.h" 12 - #include "object-store.h" 12 + #include "object-store-ll.h" 13 13 #include "parse-options.h" 14 14 #include "repository.h" 15 15 #include "blob.h"
+2 -1
builtin/mktag.c
··· 2 2 #include "gettext.h" 3 3 #include "hex.h" 4 4 #include "parse-options.h" 5 + #include "strbuf.h" 5 6 #include "tag.h" 6 7 #include "replace-object.h" 7 8 #include "object-file.h" 8 - #include "object-store.h" 9 + #include "object-store-ll.h" 9 10 #include "fsck.h" 10 11 #include "config.h" 11 12
+2 -1
builtin/mktree.c
··· 8 8 #include "gettext.h" 9 9 #include "hex.h" 10 10 #include "quote.h" 11 + #include "strbuf.h" 11 12 #include "tree.h" 12 13 #include "parse-options.h" 13 - #include "object-store.h" 14 + #include "object-store-ll.h" 14 15 15 16 static struct treeent { 16 17 unsigned mode;
+2 -1
builtin/multi-pack-index.c
··· 5 5 #include "gettext.h" 6 6 #include "parse-options.h" 7 7 #include "midx.h" 8 + #include "strbuf.h" 8 9 #include "trace2.h" 9 - #include "object-store.h" 10 + #include "object-store-ll.h" 10 11 11 12 #define BUILTIN_MIDX_WRITE_USAGE \ 12 13 N_("git multi-pack-index [<options>] write [--preferred-pack=<pack>]" \
+1 -1
builtin/notes.c
··· 14 14 #include "hex.h" 15 15 #include "notes.h" 16 16 #include "object-name.h" 17 - #include "object-store.h" 17 + #include "object-store-ll.h" 18 18 #include "path.h" 19 19 #include "repository.h" 20 20 #include "blob.h"
+1 -1
builtin/pack-objects.c
··· 34 34 #include "list.h" 35 35 #include "packfile.h" 36 36 #include "object-file.h" 37 - #include "object-store.h" 37 + #include "object-store-ll.h" 38 38 #include "replace-object.h" 39 39 #include "dir.h" 40 40 #include "midx.h"
+1 -1
builtin/pack-redundant.c
··· 11 11 #include "hex.h" 12 12 #include "repository.h" 13 13 #include "packfile.h" 14 - #include "object-store.h" 14 + #include "object-store-ll.h" 15 15 16 16 #define BLKSIZE 512 17 17
+2 -1
builtin/prune.c
··· 1 1 #include "builtin.h" 2 2 #include "commit.h" 3 3 #include "diff.h" 4 + #include "dir.h" 4 5 #include "environment.h" 5 6 #include "gettext.h" 6 7 #include "hex.h" ··· 13 14 #include "replace-object.h" 14 15 #include "object-file.h" 15 16 #include "object-name.h" 16 - #include "object-store.h" 17 + #include "object-store-ll.h" 17 18 #include "shallow.h" 18 19 19 20 static const char * const prune_usage[] = {
+1 -1
builtin/receive-pack.c
··· 30 30 #include "oidset.h" 31 31 #include "packfile.h" 32 32 #include "object-name.h" 33 - #include "object-store.h" 33 + #include "object-store-ll.h" 34 34 #include "path.h" 35 35 #include "protocol.h" 36 36 #include "commit-reach.h"
+1 -1
builtin/remote.c
··· 11 11 #include "rebase.h" 12 12 #include "refs.h" 13 13 #include "refspec.h" 14 - #include "object-store.h" 14 + #include "object-store-ll.h" 15 15 #include "strvec.h" 16 16 #include "commit-reach.h" 17 17 #include "progress.h"
+1 -1
builtin/repack.c
··· 16 16 #include "midx.h" 17 17 #include "packfile.h" 18 18 #include "prune-packed.h" 19 - #include "object-store.h" 19 + #include "object-store-ll.h" 20 20 #include "promisor-remote.h" 21 21 #include "shallow.h" 22 22 #include "pack.h"
+1 -1
builtin/replace.c
··· 20 20 #include "run-command.h" 21 21 #include "object-file.h" 22 22 #include "object-name.h" 23 - #include "object-store.h" 23 + #include "object-store-ll.h" 24 24 #include "replace-object.h" 25 25 #include "repository.h" 26 26 #include "tag.h"
+1 -1
builtin/rev-list.c
··· 12 12 #include "object.h" 13 13 #include "object-name.h" 14 14 #include "object-file.h" 15 - #include "object-store.h" 15 + #include "object-store-ll.h" 16 16 #include "pack.h" 17 17 #include "pack-bitmap.h" 18 18 #include "log-tree.h"
+1 -1
builtin/show-ref.c
··· 4 4 #include "hex.h" 5 5 #include "refs.h" 6 6 #include "object-name.h" 7 - #include "object-store.h" 7 + #include "object-store-ll.h" 8 8 #include "object.h" 9 9 #include "tag.h" 10 10 #include "string-list.h"
+1 -1
builtin/submodule--helper.c
··· 29 29 #include "diff.h" 30 30 #include "object-file.h" 31 31 #include "object-name.h" 32 - #include "object-store.h" 32 + #include "object-store-ll.h" 33 33 #include "advice.h" 34 34 #include "branch.h" 35 35 #include "list-objects-filter-options.h"
+1 -1
builtin/tag.c
··· 15 15 #include "hex.h" 16 16 #include "refs.h" 17 17 #include "object-name.h" 18 - #include "object-store.h" 18 + #include "object-store-ll.h" 19 19 #include "path.h" 20 20 #include "tag.h" 21 21 #include "run-command.h"
+1 -1
builtin/unpack-file.c
··· 2 2 #include "config.h" 3 3 #include "hex.h" 4 4 #include "object-name.h" 5 - #include "object-store.h" 5 + #include "object-store-ll.h" 6 6 #include "wrapper.h" 7 7 8 8 static char *create_temp_file(struct object_id *oid)
+1 -1
builtin/unpack-objects.c
··· 5 5 #include "gettext.h" 6 6 #include "git-zlib.h" 7 7 #include "hex.h" 8 - #include "object-store.h" 8 + #include "object-store-ll.h" 9 9 #include "object.h" 10 10 #include "delta.h" 11 11 #include "pack.h"
+1 -1
builtin/verify-commit.c
··· 9 9 #include "config.h" 10 10 #include "gettext.h" 11 11 #include "object-name.h" 12 - #include "object-store.h" 12 + #include "object-store-ll.h" 13 13 #include "repository.h" 14 14 #include "commit.h" 15 15 #include "run-command.h"
+1 -1
bulk-checkin.c
··· 16 16 #include "tmp-objdir.h" 17 17 #include "packfile.h" 18 18 #include "object-file.h" 19 - #include "object-store.h" 19 + #include "object-store-ll.h" 20 20 #include "wrapper.h" 21 21 22 22 static int odb_transaction_nesting;
+1 -1
bundle-uri.c
··· 4 4 #include "copy.h" 5 5 #include "environment.h" 6 6 #include "gettext.h" 7 - #include "object-store.h" 7 + #include "object-store-ll.h" 8 8 #include "refs.h" 9 9 #include "run-command.h" 10 10 #include "hashmap.h"
+1 -1
bundle.c
··· 4 4 #include "environment.h" 5 5 #include "gettext.h" 6 6 #include "hex.h" 7 - #include "object-store.h" 7 + #include "object-store-ll.h" 8 8 #include "repository.h" 9 9 #include "object.h" 10 10 #include "commit.h"
+1 -1
cache-tree.c
··· 8 8 #include "cache-tree.h" 9 9 #include "bulk-checkin.h" 10 10 #include "object-file.h" 11 - #include "object-store.h" 11 + #include "object-store-ll.h" 12 12 #include "read-cache-ll.h" 13 13 #include "replace-object.h" 14 14 #include "promisor-remote.h"
+1 -1
combine-diff.c
··· 1 1 #include "git-compat-util.h" 2 - #include "object-store.h" 2 + #include "object-store-ll.h" 3 3 #include "commit.h" 4 4 #include "convert.h" 5 5 #include "blob.h"
+1 -1
commit-graph.c
··· 12 12 #include "hash-lookup.h" 13 13 #include "commit-graph.h" 14 14 #include "object-file.h" 15 - #include "object-store.h" 15 + #include "object-store-ll.h" 16 16 #include "oid-array.h" 17 17 #include "path.h" 18 18 #include "alloc.h"
+1 -1
commit-graph.h
··· 1 1 #ifndef COMMIT_GRAPH_H 2 2 #define COMMIT_GRAPH_H 3 3 4 - #include "object-store.h" 4 + #include "object-store-ll.h" 5 5 #include "oidset.h" 6 6 7 7 #define GIT_TEST_COMMIT_GRAPH "GIT_TEST_COMMIT_GRAPH"
+1 -1
commit.c
··· 7 7 #include "hex.h" 8 8 #include "repository.h" 9 9 #include "object-name.h" 10 - #include "object-store.h" 10 + #include "object-store-ll.h" 11 11 #include "pkt-line.h" 12 12 #include "utf8.h" 13 13 #include "diff.h"
+1 -1
config.c
··· 25 25 #include "hashmap.h" 26 26 #include "string-list.h" 27 27 #include "object-name.h" 28 - #include "object-store.h" 28 + #include "object-store-ll.h" 29 29 #include "pager.h" 30 30 #include "path.h" 31 31 #include "utf8.h"
+1 -1
connected.c
··· 1 1 #include "git-compat-util.h" 2 2 #include "gettext.h" 3 3 #include "hex.h" 4 - #include "object-store.h" 4 + #include "object-store-ll.h" 5 5 #include "run-command.h" 6 6 #include "sigchain.h" 7 7 #include "connected.h"
+1 -1
convert.c
··· 5 5 #include "copy.h" 6 6 #include "gettext.h" 7 7 #include "hex.h" 8 - #include "object-store.h" 8 + #include "object-store-ll.h" 9 9 #include "attr.h" 10 10 #include "run-command.h" 11 11 #include "quote.h"
+1 -1
diagnose.c
··· 7 7 #include "gettext.h" 8 8 #include "hex.h" 9 9 #include "strvec.h" 10 - #include "object-store.h" 10 + #include "object-store-ll.h" 11 11 #include "packfile.h" 12 12 #include "parse-options.h" 13 13 #include "write-or-die.h"
+1 -1
diff.c
··· 20 20 #include "attr.h" 21 21 #include "run-command.h" 22 22 #include "utf8.h" 23 - #include "object-store.h" 23 + #include "object-store-ll.h" 24 24 #include "userdiff.h" 25 25 #include "submodule-config.h" 26 26 #include "submodule.h"
+1 -1
diffcore-rename.c
··· 6 6 #include "alloc.h" 7 7 #include "diff.h" 8 8 #include "diffcore.h" 9 - #include "object-store.h" 9 + #include "object-store-ll.h" 10 10 #include "hashmap.h" 11 11 #include "mem-pool.h" 12 12 #include "oid-array.h"
+1 -1
dir.c
··· 15 15 #include "gettext.h" 16 16 #include "name-hash.h" 17 17 #include "object-file.h" 18 - #include "object-store.h" 18 + #include "object-store-ll.h" 19 19 #include "path.h" 20 20 #include "attr.h" 21 21 #include "refs.h"
+1 -1
entry.c
··· 1 1 #include "git-compat-util.h" 2 2 #include "blob.h" 3 - #include "object-store.h" 3 + #include "object-store-ll.h" 4 4 #include "dir.h" 5 5 #include "environment.h" 6 6 #include "gettext.h"
+1 -1
environment.c
··· 20 20 #include "commit.h" 21 21 #include "strvec.h" 22 22 #include "object-file.h" 23 - #include "object-store.h" 23 + #include "object-store-ll.h" 24 24 #include "path.h" 25 25 #include "replace-object.h" 26 26 #include "tmp-objdir.h"
+1 -1
fetch-pack.c
··· 24 24 #include "oid-array.h" 25 25 #include "oidset.h" 26 26 #include "packfile.h" 27 - #include "object-store.h" 27 + #include "object-store-ll.h" 28 28 #include "path.h" 29 29 #include "connected.h" 30 30 #include "fetch-negotiator.h"
+1 -1
fmt-merge-msg.c
··· 4 4 #include "environment.h" 5 5 #include "refs.h" 6 6 #include "object-name.h" 7 - #include "object-store.h" 7 + #include "object-store-ll.h" 8 8 #include "diff.h" 9 9 #include "diff-merges.h" 10 10 #include "hex.h"
+2 -1
fsck.c
··· 1 1 #include "git-compat-util.h" 2 2 #include "alloc.h" 3 3 #include "date.h" 4 + #include "dir.h" 4 5 #include "hex.h" 5 - #include "object-store.h" 6 + #include "object-store-ll.h" 6 7 #include "path.h" 7 8 #include "repository.h" 8 9 #include "object.h"
+1 -1
grep.c
··· 3 3 #include "gettext.h" 4 4 #include "grep.h" 5 5 #include "hex.h" 6 - #include "object-store.h" 6 + #include "object-store-ll.h" 7 7 #include "pretty.h" 8 8 #include "userdiff.h" 9 9 #include "xdiff-interface.h"
+1 -1
http-backend.c
··· 16 16 #include "url.h" 17 17 #include "strvec.h" 18 18 #include "packfile.h" 19 - #include "object-store.h" 19 + #include "object-store-ll.h" 20 20 #include "protocol.h" 21 21 #include "date.h" 22 22 #include "wrapper.h"
+1 -1
http-push.c
··· 18 18 #include "tree.h" 19 19 #include "tree-walk.h" 20 20 #include "packfile.h" 21 - #include "object-store.h" 21 + #include "object-store-ll.h" 22 22 #include "commit-reach.h" 23 23 24 24 #ifdef EXPAT_NEEDS_XMLPARSE_H
+1 -1
http-walker.c
··· 7 7 #include "list.h" 8 8 #include "transport.h" 9 9 #include "packfile.h" 10 - #include "object-store.h" 10 + #include "object-store-ll.h" 11 11 12 12 struct alt_base { 13 13 char *base;
+1 -1
http.c
··· 18 18 #include "protocol.h" 19 19 #include "string-list.h" 20 20 #include "object-file.h" 21 - #include "object-store.h" 21 + #include "object-store-ll.h" 22 22 23 23 static struct trace_key trace_curl = TRACE_KEY_INIT(CURL); 24 24 static int trace_curl_data = 1;
+1 -1
list-objects-filter.c
··· 16 16 #include "oidmap.h" 17 17 #include "oidset.h" 18 18 #include "object-name.h" 19 - #include "object-store.h" 19 + #include "object-store-ll.h" 20 20 21 21 /* Remember to update object flag allocation in object.h */ 22 22 /*
+1 -1
list-objects.c
··· 12 12 #include "list-objects-filter.h" 13 13 #include "list-objects-filter-options.h" 14 14 #include "packfile.h" 15 - #include "object-store.h" 15 + #include "object-store-ll.h" 16 16 #include "trace.h" 17 17 18 18 struct traversal_context {
+1 -1
log-tree.c
··· 5 5 #include "environment.h" 6 6 #include "hex.h" 7 7 #include "object-name.h" 8 - #include "object-store.h" 8 + #include "object-store-ll.h" 9 9 #include "repository.h" 10 10 #include "tmp-objdir.h" 11 11 #include "commit.h"
+1 -1
mailmap.c
··· 3 3 #include "string-list.h" 4 4 #include "mailmap.h" 5 5 #include "object-name.h" 6 - #include "object-store.h" 6 + #include "object-store-ll.h" 7 7 #include "setup.h" 8 8 9 9 const char *git_mailmap_file;
+2 -1
match-trees.c
··· 1 1 #include "git-compat-util.h" 2 2 #include "hex.h" 3 3 #include "match-trees.h" 4 + #include "strbuf.h" 4 5 #include "tree.h" 5 6 #include "tree-walk.h" 6 - #include "object-store.h" 7 + #include "object-store-ll.h" 7 8 8 9 static int score_missing(unsigned mode) 9 10 {
+1 -1
merge-blobs.c
··· 4 4 #include "merge-ll.h" 5 5 #include "blob.h" 6 6 #include "merge-blobs.h" 7 - #include "object-store.h" 7 + #include "object-store-ll.h" 8 8 9 9 static int fill_mmfile_blob(mmfile_t *f, struct blob *obj) 10 10 {
+1 -1
merge-ort.c
··· 34 34 #include "match-trees.h" 35 35 #include "mem-pool.h" 36 36 #include "object-name.h" 37 - #include "object-store.h" 37 + #include "object-store-ll.h" 38 38 #include "oid-array.h" 39 39 #include "path.h" 40 40 #include "promisor-remote.h"
+1 -1
merge-recursive.c
··· 26 26 #include "name-hash.h" 27 27 #include "object-file.h" 28 28 #include "object-name.h" 29 - #include "object-store.h" 29 + #include "object-store-ll.h" 30 30 #include "path.h" 31 31 #include "repository.h" 32 32 #include "revision.h"
+1 -1
midx.c
··· 9 9 #include "lockfile.h" 10 10 #include "packfile.h" 11 11 #include "object-file.h" 12 - #include "object-store.h" 12 + #include "object-store-ll.h" 13 13 #include "hash-lookup.h" 14 14 #include "midx.h" 15 15 #include "progress.h"
+2 -1
notes-cache.c
··· 1 1 #include "git-compat-util.h" 2 2 #include "notes-cache.h" 3 - #include "object-store.h" 3 + #include "object-store-ll.h" 4 4 #include "pretty.h" 5 5 #include "repository.h" 6 6 #include "commit.h" 7 7 #include "refs.h" 8 + #include "strbuf.h" 8 9 9 10 static int notes_cache_match_validity(struct repository *r, 10 11 const char *ref,
+1 -1
notes-merge.c
··· 5 5 #include "refs.h" 6 6 #include "object-file.h" 7 7 #include "object-name.h" 8 - #include "object-store.h" 8 + #include "object-store-ll.h" 9 9 #include "path.h" 10 10 #include "repository.h" 11 11 #include "diff.h"
+1 -1
notes.c
··· 4 4 #include "hex.h" 5 5 #include "notes.h" 6 6 #include "object-name.h" 7 - #include "object-store.h" 7 + #include "object-store-ll.h" 8 8 #include "blob.h" 9 9 #include "tree.h" 10 10 #include "utf8.h"
+1 -1
object-name.c
··· 17 17 #include "oidtree.h" 18 18 #include "packfile.h" 19 19 #include "pretty.h" 20 - #include "object-store.h" 20 + #include "object-store-ll.h" 21 21 #include "read-cache-ll.h" 22 22 #include "repository.h" 23 23 #include "setup.h"
+533
object-store-ll.h
··· 1 + #ifndef OBJECT_STORE_LL_H 2 + #define OBJECT_STORE_LL_H 3 + 4 + #include "hashmap.h" 5 + #include "object.h" 6 + #include "list.h" 7 + #include "thread-utils.h" 8 + #include "oidset.h" 9 + 10 + struct oidmap; 11 + struct oidtree; 12 + struct strbuf; 13 + 14 + struct object_directory { 15 + struct object_directory *next; 16 + 17 + /* 18 + * Used to store the results of readdir(3) calls when we are OK 19 + * sacrificing accuracy due to races for speed. That includes 20 + * object existence with OBJECT_INFO_QUICK, as well as 21 + * our search for unique abbreviated hashes. Don't use it for tasks 22 + * requiring greater accuracy! 23 + * 24 + * Be sure to call odb_load_loose_cache() before using. 25 + */ 26 + uint32_t loose_objects_subdir_seen[8]; /* 256 bits */ 27 + struct oidtree *loose_objects_cache; 28 + 29 + /* 30 + * This is a temporary object store created by the tmp_objdir 31 + * facility. Disable ref updates since the objects in the store 32 + * might be discarded on rollback. 33 + */ 34 + int disable_ref_updates; 35 + 36 + /* 37 + * This object store is ephemeral, so there is no need to fsync. 38 + */ 39 + int will_destroy; 40 + 41 + /* 42 + * Path to the alternative object store. If this is a relative path, 43 + * it is relative to the current working directory. 44 + */ 45 + char *path; 46 + }; 47 + 48 + struct input_stream { 49 + const void *(*read)(struct input_stream *, unsigned long *len); 50 + void *data; 51 + int is_finished; 52 + }; 53 + 54 + void prepare_alt_odb(struct repository *r); 55 + int has_alt_odb(struct repository *r); 56 + char *compute_alternate_path(const char *path, struct strbuf *err); 57 + struct object_directory *find_odb(struct repository *r, const char *obj_dir); 58 + typedef int alt_odb_fn(struct object_directory *, void *); 59 + int foreach_alt_odb(alt_odb_fn, void*); 60 + typedef void alternate_ref_fn(const struct object_id *oid, void *); 61 + void for_each_alternate_ref(alternate_ref_fn, void *); 62 + 63 + /* 64 + * Add the directory to the on-disk alternates file; the new entry will also 65 + * take effect in the current process. 66 + */ 67 + void add_to_alternates_file(const char *dir); 68 + 69 + /* 70 + * Add the directory to the in-memory list of alternates (along with any 71 + * recursive alternates it points to), but do not modify the on-disk alternates 72 + * file. 73 + */ 74 + void add_to_alternates_memory(const char *dir); 75 + 76 + /* 77 + * Replace the current writable object directory with the specified temporary 78 + * object directory; returns the former primary object directory. 79 + */ 80 + struct object_directory *set_temporary_primary_odb(const char *dir, int will_destroy); 81 + 82 + /* 83 + * Restore a previous ODB replaced by set_temporary_main_odb. 84 + */ 85 + void restore_primary_odb(struct object_directory *restore_odb, const char *old_path); 86 + 87 + /* 88 + * Populate and return the loose object cache array corresponding to the 89 + * given object ID. 90 + */ 91 + struct oidtree *odb_loose_cache(struct object_directory *odb, 92 + const struct object_id *oid); 93 + 94 + /* Empty the loose object cache for the specified object directory. */ 95 + void odb_clear_loose_cache(struct object_directory *odb); 96 + 97 + /* Clear and free the specified object directory */ 98 + void free_object_directory(struct object_directory *odb); 99 + 100 + struct packed_git { 101 + struct hashmap_entry packmap_ent; 102 + struct packed_git *next; 103 + struct list_head mru; 104 + struct pack_window *windows; 105 + off_t pack_size; 106 + const void *index_data; 107 + size_t index_size; 108 + uint32_t num_objects; 109 + uint32_t crc_offset; 110 + struct oidset bad_objects; 111 + int index_version; 112 + time_t mtime; 113 + int pack_fd; 114 + int index; /* for builtin/pack-objects.c */ 115 + unsigned pack_local:1, 116 + pack_keep:1, 117 + pack_keep_in_core:1, 118 + freshened:1, 119 + do_not_close:1, 120 + pack_promisor:1, 121 + multi_pack_index:1, 122 + is_cruft:1; 123 + unsigned char hash[GIT_MAX_RAWSZ]; 124 + struct revindex_entry *revindex; 125 + const uint32_t *revindex_data; 126 + const uint32_t *revindex_map; 127 + size_t revindex_size; 128 + /* 129 + * mtimes_map points at the beginning of the memory mapped region of 130 + * this pack's corresponding .mtimes file, and mtimes_size is the size 131 + * of that .mtimes file 132 + */ 133 + const uint32_t *mtimes_map; 134 + size_t mtimes_size; 135 + /* something like ".git/objects/pack/xxxxx.pack" */ 136 + char pack_name[FLEX_ARRAY]; /* more */ 137 + }; 138 + 139 + struct multi_pack_index; 140 + 141 + static inline int pack_map_entry_cmp(const void *cmp_data UNUSED, 142 + const struct hashmap_entry *entry, 143 + const struct hashmap_entry *entry2, 144 + const void *keydata) 145 + { 146 + const char *key = keydata; 147 + const struct packed_git *pg1, *pg2; 148 + 149 + pg1 = container_of(entry, const struct packed_git, packmap_ent); 150 + pg2 = container_of(entry2, const struct packed_git, packmap_ent); 151 + 152 + return strcmp(pg1->pack_name, key ? key : pg2->pack_name); 153 + } 154 + 155 + struct raw_object_store { 156 + /* 157 + * Set of all object directories; the main directory is first (and 158 + * cannot be NULL after initialization). Subsequent directories are 159 + * alternates. 160 + */ 161 + struct object_directory *odb; 162 + struct object_directory **odb_tail; 163 + struct kh_odb_path_map *odb_by_path; 164 + 165 + int loaded_alternates; 166 + 167 + /* 168 + * A list of alternate object directories loaded from the environment; 169 + * this should not generally need to be accessed directly, but will 170 + * populate the "odb" list when prepare_alt_odb() is run. 171 + */ 172 + char *alternate_db; 173 + 174 + /* 175 + * Objects that should be substituted by other objects 176 + * (see git-replace(1)). 177 + */ 178 + struct oidmap *replace_map; 179 + unsigned replace_map_initialized : 1; 180 + pthread_mutex_t replace_mutex; /* protect object replace functions */ 181 + 182 + struct commit_graph *commit_graph; 183 + unsigned commit_graph_attempted : 1; /* if loading has been attempted */ 184 + 185 + /* 186 + * private data 187 + * 188 + * should only be accessed directly by packfile.c and midx.c 189 + */ 190 + struct multi_pack_index *multi_pack_index; 191 + 192 + /* 193 + * private data 194 + * 195 + * should only be accessed directly by packfile.c 196 + */ 197 + 198 + struct packed_git *packed_git; 199 + /* A most-recently-used ordered version of the packed_git list. */ 200 + struct list_head packed_git_mru; 201 + 202 + struct { 203 + struct packed_git **packs; 204 + unsigned flags; 205 + } kept_pack_cache; 206 + 207 + /* 208 + * A map of packfiles to packed_git structs for tracking which 209 + * packs have been loaded already. 210 + */ 211 + struct hashmap pack_map; 212 + 213 + /* 214 + * A fast, rough count of the number of objects in the repository. 215 + * These two fields are not meant for direct access. Use 216 + * repo_approximate_object_count() instead. 217 + */ 218 + unsigned long approximate_object_count; 219 + unsigned approximate_object_count_valid : 1; 220 + 221 + /* 222 + * Whether packed_git has already been populated with this repository's 223 + * packs. 224 + */ 225 + unsigned packed_git_initialized : 1; 226 + }; 227 + 228 + struct raw_object_store *raw_object_store_new(void); 229 + void raw_object_store_clear(struct raw_object_store *o); 230 + 231 + /* 232 + * Put in `buf` the name of the file in the local object database that 233 + * would be used to store a loose object with the specified oid. 234 + */ 235 + const char *loose_object_path(struct repository *r, struct strbuf *buf, 236 + const struct object_id *oid); 237 + 238 + void *map_loose_object(struct repository *r, const struct object_id *oid, 239 + unsigned long *size); 240 + 241 + void *repo_read_object_file(struct repository *r, 242 + const struct object_id *oid, 243 + enum object_type *type, 244 + unsigned long *size); 245 + 246 + /* Read and unpack an object file into memory, write memory to an object file */ 247 + int oid_object_info(struct repository *r, const struct object_id *, unsigned long *); 248 + 249 + void hash_object_file(const struct git_hash_algo *algo, const void *buf, 250 + unsigned long len, enum object_type type, 251 + struct object_id *oid); 252 + 253 + int write_object_file_flags(const void *buf, unsigned long len, 254 + enum object_type type, struct object_id *oid, 255 + unsigned flags); 256 + static inline int write_object_file(const void *buf, unsigned long len, 257 + enum object_type type, struct object_id *oid) 258 + { 259 + return write_object_file_flags(buf, len, type, oid, 0); 260 + } 261 + 262 + int write_object_file_literally(const void *buf, unsigned long len, 263 + const char *type, struct object_id *oid, 264 + unsigned flags); 265 + int stream_loose_object(struct input_stream *in_stream, size_t len, 266 + struct object_id *oid); 267 + 268 + /* 269 + * Add an object file to the in-memory object store, without writing it 270 + * to disk. 271 + * 272 + * Callers are responsible for calling write_object_file to record the 273 + * object in persistent storage before writing any other new objects 274 + * that reference it. 275 + */ 276 + int pretend_object_file(void *, unsigned long, enum object_type, 277 + struct object_id *oid); 278 + 279 + int force_object_loose(const struct object_id *oid, time_t mtime); 280 + 281 + struct object_info { 282 + /* Request */ 283 + enum object_type *typep; 284 + unsigned long *sizep; 285 + off_t *disk_sizep; 286 + struct object_id *delta_base_oid; 287 + struct strbuf *type_name; 288 + void **contentp; 289 + 290 + /* Response */ 291 + enum { 292 + OI_CACHED, 293 + OI_LOOSE, 294 + OI_PACKED, 295 + OI_DBCACHED 296 + } whence; 297 + union { 298 + /* 299 + * struct { 300 + * ... Nothing to expose in this case 301 + * } cached; 302 + * struct { 303 + * ... Nothing to expose in this case 304 + * } loose; 305 + */ 306 + struct { 307 + struct packed_git *pack; 308 + off_t offset; 309 + unsigned int is_delta; 310 + } packed; 311 + } u; 312 + }; 313 + 314 + /* 315 + * Initializer for a "struct object_info" that wants no items. You may 316 + * also memset() the memory to all-zeroes. 317 + */ 318 + #define OBJECT_INFO_INIT { 0 } 319 + 320 + /* Invoke lookup_replace_object() on the given hash */ 321 + #define OBJECT_INFO_LOOKUP_REPLACE 1 322 + /* Allow reading from a loose object file of unknown/bogus type */ 323 + #define OBJECT_INFO_ALLOW_UNKNOWN_TYPE 2 324 + /* Do not retry packed storage after checking packed and loose storage */ 325 + #define OBJECT_INFO_QUICK 8 326 + /* 327 + * Do not attempt to fetch the object if missing (even if fetch_is_missing is 328 + * nonzero). 329 + */ 330 + #define OBJECT_INFO_SKIP_FETCH_OBJECT 16 331 + /* 332 + * This is meant for bulk prefetching of missing blobs in a partial 333 + * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK 334 + */ 335 + #define OBJECT_INFO_FOR_PREFETCH (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK) 336 + 337 + /* Die if object corruption (not just an object being missing) was detected. */ 338 + #define OBJECT_INFO_DIE_IF_CORRUPT 32 339 + 340 + int oid_object_info_extended(struct repository *r, 341 + const struct object_id *, 342 + struct object_info *, unsigned flags); 343 + 344 + /* 345 + * Open the loose object at path, check its hash, and return the contents, 346 + * use the "oi" argument to assert things about the object, or e.g. populate its 347 + * type, and size. If the object is a blob, then "contents" may return NULL, 348 + * to allow streaming of large blobs. 349 + * 350 + * Returns 0 on success, negative on error (details may be written to stderr). 351 + */ 352 + int read_loose_object(const char *path, 353 + const struct object_id *expected_oid, 354 + struct object_id *real_oid, 355 + void **contents, 356 + struct object_info *oi); 357 + 358 + /* Retry packed storage after checking packed and loose storage */ 359 + #define HAS_OBJECT_RECHECK_PACKED 1 360 + 361 + /* 362 + * Returns 1 if the object exists. This function will not lazily fetch objects 363 + * in a partial clone. 364 + */ 365 + int has_object(struct repository *r, const struct object_id *oid, 366 + unsigned flags); 367 + 368 + /* 369 + * These macros and functions are deprecated. If checking existence for an 370 + * object that is likely to be missing and/or whose absence is relatively 371 + * inconsequential (or is consequential but the caller is prepared to handle 372 + * it), use has_object(), which has better defaults (no lazy fetch in a partial 373 + * clone and no rechecking of packed storage). In the unlikely event that a 374 + * caller needs to assert existence of an object that it fully expects to 375 + * exist, and wants to trigger a lazy fetch in a partial clone, use 376 + * oid_object_info_extended() with a NULL struct object_info. 377 + * 378 + * These functions can be removed once all callers have migrated to 379 + * has_object() and/or oid_object_info_extended(). 380 + */ 381 + int repo_has_object_file(struct repository *r, const struct object_id *oid); 382 + int repo_has_object_file_with_flags(struct repository *r, 383 + const struct object_id *oid, int flags); 384 + 385 + /* 386 + * Return true iff an alternate object database has a loose object 387 + * with the specified name. This function does not respect replace 388 + * references. 389 + */ 390 + int has_loose_object_nonlocal(const struct object_id *); 391 + 392 + int has_loose_object(const struct object_id *); 393 + 394 + /** 395 + * format_object_header() is a thin wrapper around s xsnprintf() that 396 + * writes the initial "<type> <obj-len>" part of the loose object 397 + * header. It returns the size that snprintf() returns + 1. 398 + */ 399 + int format_object_header(char *str, size_t size, enum object_type type, 400 + size_t objsize); 401 + 402 + void assert_oid_type(const struct object_id *oid, enum object_type expect); 403 + 404 + /* 405 + * Enabling the object read lock allows multiple threads to safely call the 406 + * following functions in parallel: repo_read_object_file(), 407 + * read_object_with_reference(), oid_object_info() and oid_object_info_extended(). 408 + * 409 + * obj_read_lock() and obj_read_unlock() may also be used to protect other 410 + * section which cannot execute in parallel with object reading. Since the used 411 + * lock is a recursive mutex, these sections can even contain calls to object 412 + * reading functions. However, beware that in these cases zlib inflation won't 413 + * be performed in parallel, losing performance. 414 + * 415 + * TODO: oid_object_info_extended()'s call stack has a recursive behavior. If 416 + * any of its callees end up calling it, this recursive call won't benefit from 417 + * parallel inflation. 418 + */ 419 + void enable_obj_read_lock(void); 420 + void disable_obj_read_lock(void); 421 + 422 + extern int obj_read_use_lock; 423 + extern pthread_mutex_t obj_read_mutex; 424 + 425 + static inline void obj_read_lock(void) 426 + { 427 + if(obj_read_use_lock) 428 + pthread_mutex_lock(&obj_read_mutex); 429 + } 430 + 431 + static inline void obj_read_unlock(void) 432 + { 433 + if(obj_read_use_lock) 434 + pthread_mutex_unlock(&obj_read_mutex); 435 + } 436 + 437 + /* 438 + * Iterate over the files in the loose-object parts of the object 439 + * directory "path", triggering the following callbacks: 440 + * 441 + * - loose_object is called for each loose object we find. 442 + * 443 + * - loose_cruft is called for any files that do not appear to be 444 + * loose objects. Note that we only look in the loose object 445 + * directories "objects/[0-9a-f]{2}/", so we will not report 446 + * "objects/foobar" as cruft. 447 + * 448 + * - loose_subdir is called for each top-level hashed subdirectory 449 + * of the object directory (e.g., "$OBJDIR/f0"). It is called 450 + * after the objects in the directory are processed. 451 + * 452 + * Any callback that is NULL will be ignored. Callbacks returning non-zero 453 + * will end the iteration. 454 + * 455 + * In the "buf" variant, "path" is a strbuf which will also be used as a 456 + * scratch buffer, but restored to its original contents before 457 + * the function returns. 458 + */ 459 + typedef int each_loose_object_fn(const struct object_id *oid, 460 + const char *path, 461 + void *data); 462 + typedef int each_loose_cruft_fn(const char *basename, 463 + const char *path, 464 + void *data); 465 + typedef int each_loose_subdir_fn(unsigned int nr, 466 + const char *path, 467 + void *data); 468 + int for_each_file_in_obj_subdir(unsigned int subdir_nr, 469 + struct strbuf *path, 470 + each_loose_object_fn obj_cb, 471 + each_loose_cruft_fn cruft_cb, 472 + each_loose_subdir_fn subdir_cb, 473 + void *data); 474 + int for_each_loose_file_in_objdir(const char *path, 475 + each_loose_object_fn obj_cb, 476 + each_loose_cruft_fn cruft_cb, 477 + each_loose_subdir_fn subdir_cb, 478 + void *data); 479 + int for_each_loose_file_in_objdir_buf(struct strbuf *path, 480 + each_loose_object_fn obj_cb, 481 + each_loose_cruft_fn cruft_cb, 482 + each_loose_subdir_fn subdir_cb, 483 + void *data); 484 + 485 + /* Flags for for_each_*_object() below. */ 486 + enum for_each_object_flags { 487 + /* Iterate only over local objects, not alternates. */ 488 + FOR_EACH_OBJECT_LOCAL_ONLY = (1<<0), 489 + 490 + /* Only iterate over packs obtained from the promisor remote. */ 491 + FOR_EACH_OBJECT_PROMISOR_ONLY = (1<<1), 492 + 493 + /* 494 + * Visit objects within a pack in packfile order rather than .idx order 495 + */ 496 + FOR_EACH_OBJECT_PACK_ORDER = (1<<2), 497 + 498 + /* Only iterate over packs that are not marked as kept in-core. */ 499 + FOR_EACH_OBJECT_SKIP_IN_CORE_KEPT_PACKS = (1<<3), 500 + 501 + /* Only iterate over packs that do not have .keep files. */ 502 + FOR_EACH_OBJECT_SKIP_ON_DISK_KEPT_PACKS = (1<<4), 503 + }; 504 + 505 + /* 506 + * Iterate over all accessible loose objects without respect to 507 + * reachability. By default, this includes both local and alternate objects. 508 + * The order in which objects are visited is unspecified. 509 + * 510 + * Any flags specific to packs are ignored. 511 + */ 512 + int for_each_loose_object(each_loose_object_fn, void *, 513 + enum for_each_object_flags flags); 514 + 515 + /* 516 + * Iterate over all accessible packed objects without respect to reachability. 517 + * By default, this includes both local and alternate packs. 518 + * 519 + * Note that some objects may appear twice if they are found in multiple packs. 520 + * Each pack is visited in an unspecified order. By default, objects within a 521 + * pack are visited in pack-idx order (i.e., sorted by oid). 522 + */ 523 + typedef int each_packed_object_fn(const struct object_id *oid, 524 + struct packed_git *pack, 525 + uint32_t pos, 526 + void *data); 527 + int for_each_object_in_pack(struct packed_git *p, 528 + each_packed_object_fn, void *data, 529 + enum for_each_object_flags flags); 530 + int for_each_packed_object(each_packed_object_fn, void *, 531 + enum for_each_object_flags flags); 532 + 533 + #endif /* OBJECT_STORE_LL_H */
+1 -527
object-store.h
··· 1 1 #ifndef OBJECT_STORE_H 2 2 #define OBJECT_STORE_H 3 3 4 - #include "object.h" 5 - #include "list.h" 6 - #include "thread-utils.h" 7 4 #include "khash.h" 8 5 #include "dir.h" 9 - #include "oidset.h" 10 - 11 - struct oidmap; 12 - struct oidtree; 13 - struct strbuf; 14 - 15 - struct object_directory { 16 - struct object_directory *next; 17 - 18 - /* 19 - * Used to store the results of readdir(3) calls when we are OK 20 - * sacrificing accuracy due to races for speed. That includes 21 - * object existence with OBJECT_INFO_QUICK, as well as 22 - * our search for unique abbreviated hashes. Don't use it for tasks 23 - * requiring greater accuracy! 24 - * 25 - * Be sure to call odb_load_loose_cache() before using. 26 - */ 27 - uint32_t loose_objects_subdir_seen[8]; /* 256 bits */ 28 - struct oidtree *loose_objects_cache; 29 - 30 - /* 31 - * This is a temporary object store created by the tmp_objdir 32 - * facility. Disable ref updates since the objects in the store 33 - * might be discarded on rollback. 34 - */ 35 - int disable_ref_updates; 36 - 37 - /* 38 - * This object store is ephemeral, so there is no need to fsync. 39 - */ 40 - int will_destroy; 41 - 42 - /* 43 - * Path to the alternative object store. If this is a relative path, 44 - * it is relative to the current working directory. 45 - */ 46 - char *path; 47 - }; 48 - 49 - struct input_stream { 50 - const void *(*read)(struct input_stream *, unsigned long *len); 51 - void *data; 52 - int is_finished; 53 - }; 6 + #include "object-store-ll.h" 54 7 55 8 KHASH_INIT(odb_path_map, const char * /* key: odb_path */, 56 9 struct object_directory *, 1, fspathhash, fspatheq) 57 - 58 - void prepare_alt_odb(struct repository *r); 59 - int has_alt_odb(struct repository *r); 60 - char *compute_alternate_path(const char *path, struct strbuf *err); 61 - struct object_directory *find_odb(struct repository *r, const char *obj_dir); 62 - typedef int alt_odb_fn(struct object_directory *, void *); 63 - int foreach_alt_odb(alt_odb_fn, void*); 64 - typedef void alternate_ref_fn(const struct object_id *oid, void *); 65 - void for_each_alternate_ref(alternate_ref_fn, void *); 66 - 67 - /* 68 - * Add the directory to the on-disk alternates file; the new entry will also 69 - * take effect in the current process. 70 - */ 71 - void add_to_alternates_file(const char *dir); 72 - 73 - /* 74 - * Add the directory to the in-memory list of alternates (along with any 75 - * recursive alternates it points to), but do not modify the on-disk alternates 76 - * file. 77 - */ 78 - void add_to_alternates_memory(const char *dir); 79 - 80 - /* 81 - * Replace the current writable object directory with the specified temporary 82 - * object directory; returns the former primary object directory. 83 - */ 84 - struct object_directory *set_temporary_primary_odb(const char *dir, int will_destroy); 85 - 86 - /* 87 - * Restore a previous ODB replaced by set_temporary_main_odb. 88 - */ 89 - void restore_primary_odb(struct object_directory *restore_odb, const char *old_path); 90 - 91 - /* 92 - * Populate and return the loose object cache array corresponding to the 93 - * given object ID. 94 - */ 95 - struct oidtree *odb_loose_cache(struct object_directory *odb, 96 - const struct object_id *oid); 97 - 98 - /* Empty the loose object cache for the specified object directory. */ 99 - void odb_clear_loose_cache(struct object_directory *odb); 100 - 101 - /* Clear and free the specified object directory */ 102 - void free_object_directory(struct object_directory *odb); 103 - 104 - struct packed_git { 105 - struct hashmap_entry packmap_ent; 106 - struct packed_git *next; 107 - struct list_head mru; 108 - struct pack_window *windows; 109 - off_t pack_size; 110 - const void *index_data; 111 - size_t index_size; 112 - uint32_t num_objects; 113 - uint32_t crc_offset; 114 - struct oidset bad_objects; 115 - int index_version; 116 - time_t mtime; 117 - int pack_fd; 118 - int index; /* for builtin/pack-objects.c */ 119 - unsigned pack_local:1, 120 - pack_keep:1, 121 - pack_keep_in_core:1, 122 - freshened:1, 123 - do_not_close:1, 124 - pack_promisor:1, 125 - multi_pack_index:1, 126 - is_cruft:1; 127 - unsigned char hash[GIT_MAX_RAWSZ]; 128 - struct revindex_entry *revindex; 129 - const uint32_t *revindex_data; 130 - const uint32_t *revindex_map; 131 - size_t revindex_size; 132 - /* 133 - * mtimes_map points at the beginning of the memory mapped region of 134 - * this pack's corresponding .mtimes file, and mtimes_size is the size 135 - * of that .mtimes file 136 - */ 137 - const uint32_t *mtimes_map; 138 - size_t mtimes_size; 139 - /* something like ".git/objects/pack/xxxxx.pack" */ 140 - char pack_name[FLEX_ARRAY]; /* more */ 141 - }; 142 - 143 - struct multi_pack_index; 144 - 145 - static inline int pack_map_entry_cmp(const void *cmp_data UNUSED, 146 - const struct hashmap_entry *entry, 147 - const struct hashmap_entry *entry2, 148 - const void *keydata) 149 - { 150 - const char *key = keydata; 151 - const struct packed_git *pg1, *pg2; 152 - 153 - pg1 = container_of(entry, const struct packed_git, packmap_ent); 154 - pg2 = container_of(entry2, const struct packed_git, packmap_ent); 155 - 156 - return strcmp(pg1->pack_name, key ? key : pg2->pack_name); 157 - } 158 - 159 - struct raw_object_store { 160 - /* 161 - * Set of all object directories; the main directory is first (and 162 - * cannot be NULL after initialization). Subsequent directories are 163 - * alternates. 164 - */ 165 - struct object_directory *odb; 166 - struct object_directory **odb_tail; 167 - struct kh_odb_path_map *odb_by_path; 168 - 169 - int loaded_alternates; 170 - 171 - /* 172 - * A list of alternate object directories loaded from the environment; 173 - * this should not generally need to be accessed directly, but will 174 - * populate the "odb" list when prepare_alt_odb() is run. 175 - */ 176 - char *alternate_db; 177 - 178 - /* 179 - * Objects that should be substituted by other objects 180 - * (see git-replace(1)). 181 - */ 182 - struct oidmap *replace_map; 183 - unsigned replace_map_initialized : 1; 184 - pthread_mutex_t replace_mutex; /* protect object replace functions */ 185 - 186 - struct commit_graph *commit_graph; 187 - unsigned commit_graph_attempted : 1; /* if loading has been attempted */ 188 - 189 - /* 190 - * private data 191 - * 192 - * should only be accessed directly by packfile.c and midx.c 193 - */ 194 - struct multi_pack_index *multi_pack_index; 195 - 196 - /* 197 - * private data 198 - * 199 - * should only be accessed directly by packfile.c 200 - */ 201 - 202 - struct packed_git *packed_git; 203 - /* A most-recently-used ordered version of the packed_git list. */ 204 - struct list_head packed_git_mru; 205 - 206 - struct { 207 - struct packed_git **packs; 208 - unsigned flags; 209 - } kept_pack_cache; 210 - 211 - /* 212 - * A map of packfiles to packed_git structs for tracking which 213 - * packs have been loaded already. 214 - */ 215 - struct hashmap pack_map; 216 - 217 - /* 218 - * A fast, rough count of the number of objects in the repository. 219 - * These two fields are not meant for direct access. Use 220 - * repo_approximate_object_count() instead. 221 - */ 222 - unsigned long approximate_object_count; 223 - unsigned approximate_object_count_valid : 1; 224 - 225 - /* 226 - * Whether packed_git has already been populated with this repository's 227 - * packs. 228 - */ 229 - unsigned packed_git_initialized : 1; 230 - }; 231 - 232 - struct raw_object_store *raw_object_store_new(void); 233 - void raw_object_store_clear(struct raw_object_store *o); 234 - 235 - /* 236 - * Put in `buf` the name of the file in the local object database that 237 - * would be used to store a loose object with the specified oid. 238 - */ 239 - const char *loose_object_path(struct repository *r, struct strbuf *buf, 240 - const struct object_id *oid); 241 - 242 - void *map_loose_object(struct repository *r, const struct object_id *oid, 243 - unsigned long *size); 244 - 245 - void *repo_read_object_file(struct repository *r, 246 - const struct object_id *oid, 247 - enum object_type *type, 248 - unsigned long *size); 249 - 250 - /* Read and unpack an object file into memory, write memory to an object file */ 251 - int oid_object_info(struct repository *r, const struct object_id *, unsigned long *); 252 - 253 - void hash_object_file(const struct git_hash_algo *algo, const void *buf, 254 - unsigned long len, enum object_type type, 255 - struct object_id *oid); 256 - 257 - int write_object_file_flags(const void *buf, unsigned long len, 258 - enum object_type type, struct object_id *oid, 259 - unsigned flags); 260 - static inline int write_object_file(const void *buf, unsigned long len, 261 - enum object_type type, struct object_id *oid) 262 - { 263 - return write_object_file_flags(buf, len, type, oid, 0); 264 - } 265 - 266 - int write_object_file_literally(const void *buf, unsigned long len, 267 - const char *type, struct object_id *oid, 268 - unsigned flags); 269 - int stream_loose_object(struct input_stream *in_stream, size_t len, 270 - struct object_id *oid); 271 - 272 - /* 273 - * Add an object file to the in-memory object store, without writing it 274 - * to disk. 275 - * 276 - * Callers are responsible for calling write_object_file to record the 277 - * object in persistent storage before writing any other new objects 278 - * that reference it. 279 - */ 280 - int pretend_object_file(void *, unsigned long, enum object_type, 281 - struct object_id *oid); 282 - 283 - int force_object_loose(const struct object_id *oid, time_t mtime); 284 - 285 - struct object_info { 286 - /* Request */ 287 - enum object_type *typep; 288 - unsigned long *sizep; 289 - off_t *disk_sizep; 290 - struct object_id *delta_base_oid; 291 - struct strbuf *type_name; 292 - void **contentp; 293 - 294 - /* Response */ 295 - enum { 296 - OI_CACHED, 297 - OI_LOOSE, 298 - OI_PACKED, 299 - OI_DBCACHED 300 - } whence; 301 - union { 302 - /* 303 - * struct { 304 - * ... Nothing to expose in this case 305 - * } cached; 306 - * struct { 307 - * ... Nothing to expose in this case 308 - * } loose; 309 - */ 310 - struct { 311 - struct packed_git *pack; 312 - off_t offset; 313 - unsigned int is_delta; 314 - } packed; 315 - } u; 316 - }; 317 - 318 - /* 319 - * Initializer for a "struct object_info" that wants no items. You may 320 - * also memset() the memory to all-zeroes. 321 - */ 322 - #define OBJECT_INFO_INIT { 0 } 323 - 324 - /* Invoke lookup_replace_object() on the given hash */ 325 - #define OBJECT_INFO_LOOKUP_REPLACE 1 326 - /* Allow reading from a loose object file of unknown/bogus type */ 327 - #define OBJECT_INFO_ALLOW_UNKNOWN_TYPE 2 328 - /* Do not retry packed storage after checking packed and loose storage */ 329 - #define OBJECT_INFO_QUICK 8 330 - /* 331 - * Do not attempt to fetch the object if missing (even if fetch_is_missing is 332 - * nonzero). 333 - */ 334 - #define OBJECT_INFO_SKIP_FETCH_OBJECT 16 335 - /* 336 - * This is meant for bulk prefetching of missing blobs in a partial 337 - * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK 338 - */ 339 - #define OBJECT_INFO_FOR_PREFETCH (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK) 340 - 341 - /* Die if object corruption (not just an object being missing) was detected. */ 342 - #define OBJECT_INFO_DIE_IF_CORRUPT 32 343 - 344 - int oid_object_info_extended(struct repository *r, 345 - const struct object_id *, 346 - struct object_info *, unsigned flags); 347 - 348 - /* 349 - * Open the loose object at path, check its hash, and return the contents, 350 - * use the "oi" argument to assert things about the object, or e.g. populate its 351 - * type, and size. If the object is a blob, then "contents" may return NULL, 352 - * to allow streaming of large blobs. 353 - * 354 - * Returns 0 on success, negative on error (details may be written to stderr). 355 - */ 356 - int read_loose_object(const char *path, 357 - const struct object_id *expected_oid, 358 - struct object_id *real_oid, 359 - void **contents, 360 - struct object_info *oi); 361 - 362 - /* Retry packed storage after checking packed and loose storage */ 363 - #define HAS_OBJECT_RECHECK_PACKED 1 364 - 365 - /* 366 - * Returns 1 if the object exists. This function will not lazily fetch objects 367 - * in a partial clone. 368 - */ 369 - int has_object(struct repository *r, const struct object_id *oid, 370 - unsigned flags); 371 - 372 - /* 373 - * These macros and functions are deprecated. If checking existence for an 374 - * object that is likely to be missing and/or whose absence is relatively 375 - * inconsequential (or is consequential but the caller is prepared to handle 376 - * it), use has_object(), which has better defaults (no lazy fetch in a partial 377 - * clone and no rechecking of packed storage). In the unlikely event that a 378 - * caller needs to assert existence of an object that it fully expects to 379 - * exist, and wants to trigger a lazy fetch in a partial clone, use 380 - * oid_object_info_extended() with a NULL struct object_info. 381 - * 382 - * These functions can be removed once all callers have migrated to 383 - * has_object() and/or oid_object_info_extended(). 384 - */ 385 - int repo_has_object_file(struct repository *r, const struct object_id *oid); 386 - int repo_has_object_file_with_flags(struct repository *r, 387 - const struct object_id *oid, int flags); 388 - 389 - /* 390 - * Return true iff an alternate object database has a loose object 391 - * with the specified name. This function does not respect replace 392 - * references. 393 - */ 394 - int has_loose_object_nonlocal(const struct object_id *); 395 - 396 - int has_loose_object(const struct object_id *); 397 - 398 - /** 399 - * format_object_header() is a thin wrapper around s xsnprintf() that 400 - * writes the initial "<type> <obj-len>" part of the loose object 401 - * header. It returns the size that snprintf() returns + 1. 402 - */ 403 - int format_object_header(char *str, size_t size, enum object_type type, 404 - size_t objsize); 405 - 406 - void assert_oid_type(const struct object_id *oid, enum object_type expect); 407 - 408 - /* 409 - * Enabling the object read lock allows multiple threads to safely call the 410 - * following functions in parallel: repo_read_object_file(), 411 - * read_object_with_reference(), oid_object_info() and oid_object_info_extended(). 412 - * 413 - * obj_read_lock() and obj_read_unlock() may also be used to protect other 414 - * section which cannot execute in parallel with object reading. Since the used 415 - * lock is a recursive mutex, these sections can even contain calls to object 416 - * reading functions. However, beware that in these cases zlib inflation won't 417 - * be performed in parallel, losing performance. 418 - * 419 - * TODO: oid_object_info_extended()'s call stack has a recursive behavior. If 420 - * any of its callees end up calling it, this recursive call won't benefit from 421 - * parallel inflation. 422 - */ 423 - void enable_obj_read_lock(void); 424 - void disable_obj_read_lock(void); 425 - 426 - extern int obj_read_use_lock; 427 - extern pthread_mutex_t obj_read_mutex; 428 - 429 - static inline void obj_read_lock(void) 430 - { 431 - if(obj_read_use_lock) 432 - pthread_mutex_lock(&obj_read_mutex); 433 - } 434 - 435 - static inline void obj_read_unlock(void) 436 - { 437 - if(obj_read_use_lock) 438 - pthread_mutex_unlock(&obj_read_mutex); 439 - } 440 - 441 - /* 442 - * Iterate over the files in the loose-object parts of the object 443 - * directory "path", triggering the following callbacks: 444 - * 445 - * - loose_object is called for each loose object we find. 446 - * 447 - * - loose_cruft is called for any files that do not appear to be 448 - * loose objects. Note that we only look in the loose object 449 - * directories "objects/[0-9a-f]{2}/", so we will not report 450 - * "objects/foobar" as cruft. 451 - * 452 - * - loose_subdir is called for each top-level hashed subdirectory 453 - * of the object directory (e.g., "$OBJDIR/f0"). It is called 454 - * after the objects in the directory are processed. 455 - * 456 - * Any callback that is NULL will be ignored. Callbacks returning non-zero 457 - * will end the iteration. 458 - * 459 - * In the "buf" variant, "path" is a strbuf which will also be used as a 460 - * scratch buffer, but restored to its original contents before 461 - * the function returns. 462 - */ 463 - typedef int each_loose_object_fn(const struct object_id *oid, 464 - const char *path, 465 - void *data); 466 - typedef int each_loose_cruft_fn(const char *basename, 467 - const char *path, 468 - void *data); 469 - typedef int each_loose_subdir_fn(unsigned int nr, 470 - const char *path, 471 - void *data); 472 - int for_each_file_in_obj_subdir(unsigned int subdir_nr, 473 - struct strbuf *path, 474 - each_loose_object_fn obj_cb, 475 - each_loose_cruft_fn cruft_cb, 476 - each_loose_subdir_fn subdir_cb, 477 - void *data); 478 - int for_each_loose_file_in_objdir(const char *path, 479 - each_loose_object_fn obj_cb, 480 - each_loose_cruft_fn cruft_cb, 481 - each_loose_subdir_fn subdir_cb, 482 - void *data); 483 - int for_each_loose_file_in_objdir_buf(struct strbuf *path, 484 - each_loose_object_fn obj_cb, 485 - each_loose_cruft_fn cruft_cb, 486 - each_loose_subdir_fn subdir_cb, 487 - void *data); 488 - 489 - /* Flags for for_each_*_object() below. */ 490 - enum for_each_object_flags { 491 - /* Iterate only over local objects, not alternates. */ 492 - FOR_EACH_OBJECT_LOCAL_ONLY = (1<<0), 493 - 494 - /* Only iterate over packs obtained from the promisor remote. */ 495 - FOR_EACH_OBJECT_PROMISOR_ONLY = (1<<1), 496 - 497 - /* 498 - * Visit objects within a pack in packfile order rather than .idx order 499 - */ 500 - FOR_EACH_OBJECT_PACK_ORDER = (1<<2), 501 - 502 - /* Only iterate over packs that are not marked as kept in-core. */ 503 - FOR_EACH_OBJECT_SKIP_IN_CORE_KEPT_PACKS = (1<<3), 504 - 505 - /* Only iterate over packs that do not have .keep files. */ 506 - FOR_EACH_OBJECT_SKIP_ON_DISK_KEPT_PACKS = (1<<4), 507 - }; 508 - 509 - /* 510 - * Iterate over all accessible loose objects without respect to 511 - * reachability. By default, this includes both local and alternate objects. 512 - * The order in which objects are visited is unspecified. 513 - * 514 - * Any flags specific to packs are ignored. 515 - */ 516 - int for_each_loose_object(each_loose_object_fn, void *, 517 - enum for_each_object_flags flags); 518 - 519 - /* 520 - * Iterate over all accessible packed objects without respect to reachability. 521 - * By default, this includes both local and alternate packs. 522 - * 523 - * Note that some objects may appear twice if they are found in multiple packs. 524 - * Each pack is visited in an unspecified order. By default, objects within a 525 - * pack are visited in pack-idx order (i.e., sorted by oid). 526 - */ 527 - typedef int each_packed_object_fn(const struct object_id *oid, 528 - struct packed_git *pack, 529 - uint32_t pos, 530 - void *data); 531 - int for_each_object_in_pack(struct packed_git *p, 532 - each_packed_object_fn, void *data, 533 - enum for_each_object_flags flags); 534 - int for_each_packed_object(each_packed_object_fn, void *, 535 - enum for_each_object_flags flags); 536 10 537 11 #endif /* OBJECT_STORE_H */
+1 -1
oss-fuzz/fuzz-pack-idx.c
··· 1 1 #include "git-compat-util.h" 2 - #include "object-store.h" 2 + #include "object-store-ll.h" 3 3 #include "packfile.h" 4 4 5 5 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+1 -1
pack-bitmap-write.c
··· 3 3 #include "environment.h" 4 4 #include "gettext.h" 5 5 #include "hex.h" 6 - #include "object-store.h" 6 + #include "object-store-ll.h" 7 7 #include "commit.h" 8 8 #include "tag.h" 9 9 #include "diff.h"
+1 -1
pack-bitmap.c
··· 17 17 #include "repository.h" 18 18 #include "trace2.h" 19 19 #include "object-file.h" 20 - #include "object-store.h" 20 + #include "object-store-ll.h" 21 21 #include "list-objects-filter-options.h" 22 22 #include "midx.h" 23 23 #include "config.h"
+1 -1
pack-check.c
··· 7 7 #include "progress.h" 8 8 #include "packfile.h" 9 9 #include "object-file.h" 10 - #include "object-store.h" 10 + #include "object-store-ll.h" 11 11 12 12 struct idx_entry { 13 13 off_t offset;
+2 -1
pack-mtimes.c
··· 2 2 #include "gettext.h" 3 3 #include "pack-mtimes.h" 4 4 #include "object-file.h" 5 - #include "object-store.h" 5 + #include "object-store-ll.h" 6 6 #include "packfile.h" 7 + #include "strbuf.h" 7 8 8 9 static char *pack_mtimes_filename(struct packed_git *p) 9 10 {
+1 -1
pack-objects.h
··· 1 1 #ifndef PACK_OBJECTS_H 2 2 #define PACK_OBJECTS_H 3 3 4 - #include "object-store.h" 4 + #include "object-store-ll.h" 5 5 #include "thread-utils.h" 6 6 #include "pack.h" 7 7
+2 -1
pack-revindex.c
··· 2 2 #include "gettext.h" 3 3 #include "pack-revindex.h" 4 4 #include "object-file.h" 5 - #include "object-store.h" 5 + #include "object-store-ll.h" 6 6 #include "packfile.h" 7 + #include "strbuf.h" 7 8 #include "trace2.h" 8 9 #include "config.h" 9 10 #include "midx.h"
+1
pack-write.c
··· 11 11 #include "pack-objects.h" 12 12 #include "pack-revindex.h" 13 13 #include "path.h" 14 + #include "strbuf.h" 14 15 #include "wrapper.h" 15 16 16 17 void reset_pack_idx_option(struct pack_idx_option *opts)
+1 -1
packfile.c
··· 19 19 #include "tree-walk.h" 20 20 #include "tree.h" 21 21 #include "object-file.h" 22 - #include "object-store.h" 22 + #include "object-store-ll.h" 23 23 #include "midx.h" 24 24 #include "commit-graph.h" 25 25 #include "pack-revindex.h"
+1 -1
path.c
··· 15 15 #include "submodule-config.h" 16 16 #include "path.h" 17 17 #include "packfile.h" 18 - #include "object-store.h" 18 + #include "object-store-ll.h" 19 19 #include "lockfile.h" 20 20 #include "exec-cmd.h" 21 21 #include "wrapper.h"
+1 -1
promisor-remote.c
··· 1 1 #include "git-compat-util.h" 2 2 #include "gettext.h" 3 3 #include "hex.h" 4 - #include "object-store.h" 4 + #include "object-store-ll.h" 5 5 #include "promisor-remote.h" 6 6 #include "config.h" 7 7 #include "trace2.h"
+1 -1
protocol-caps.c
··· 7 7 #include "hash-ll.h" 8 8 #include "hex.h" 9 9 #include "object.h" 10 - #include "object-store.h" 10 + #include "object-store-ll.h" 11 11 #include "string-list.h" 12 12 #include "strbuf.h" 13 13
+1 -1
prune-packed.c
··· 1 1 #include "git-compat-util.h" 2 2 #include "environment.h" 3 3 #include "gettext.h" 4 - #include "object-store.h" 4 + #include "object-store-ll.h" 5 5 #include "packfile.h" 6 6 #include "progress.h" 7 7 #include "prune-packed.h"
+1 -1
reachable.c
··· 13 13 #include "list-objects.h" 14 14 #include "packfile.h" 15 15 #include "worktree.h" 16 - #include "object-store.h" 16 + #include "object-store-ll.h" 17 17 #include "pack-bitmap.h" 18 18 #include "pack-mtimes.h" 19 19
+1 -1
read-cache.c
··· 17 17 #include "refs.h" 18 18 #include "dir.h" 19 19 #include "object-file.h" 20 - #include "object-store.h" 20 + #include "object-store-ll.h" 21 21 #include "oid-array.h" 22 22 #include "tree.h" 23 23 #include "commit.h"
+1 -1
ref-filter.c
··· 8 8 #include "refs.h" 9 9 #include "wildmatch.h" 10 10 #include "object-name.h" 11 - #include "object-store.h" 11 + #include "object-store-ll.h" 12 12 #include "oid-array.h" 13 13 #include "repository.h" 14 14 #include "commit.h"
+1 -1
reflog.c
··· 1 1 #include "git-compat-util.h" 2 2 #include "gettext.h" 3 - #include "object-store.h" 3 + #include "object-store-ll.h" 4 4 #include "reflog.h" 5 5 #include "refs.h" 6 6 #include "revision.h"
+1 -1
refs.c
··· 17 17 #include "run-command.h" 18 18 #include "hook.h" 19 19 #include "object-name.h" 20 - #include "object-store.h" 20 + #include "object-store-ll.h" 21 21 #include "object.h" 22 22 #include "path.h" 23 23 #include "tag.h"
+1 -1
remote.c
··· 10 10 #include "refs.h" 11 11 #include "refspec.h" 12 12 #include "object-name.h" 13 - #include "object-store.h" 13 + #include "object-store-ll.h" 14 14 #include "path.h" 15 15 #include "commit.h" 16 16 #include "diff.h"
+1 -1
replace-object.c
··· 2 2 #include "gettext.h" 3 3 #include "hex.h" 4 4 #include "oidmap.h" 5 - #include "object-store.h" 5 + #include "object-store-ll.h" 6 6 #include "replace-object.h" 7 7 #include "refs.h" 8 8 #include "repository.h"
+1 -1
replace-object.h
··· 3 3 4 4 #include "oidmap.h" 5 5 #include "repository.h" 6 - #include "object-store.h" 6 + #include "object-store-ll.h" 7 7 8 8 /* 9 9 * Do replace refs need to be checked this run? This variable is
+1 -1
repository.c
··· 6 6 #include "git-compat-util.h" 7 7 #include "abspath.h" 8 8 #include "repository.h" 9 - #include "object-store.h" 9 + #include "object-store-ll.h" 10 10 #include "config.h" 11 11 #include "object.h" 12 12 #include "lockfile.h"
+1 -1
rerere.c
··· 17 17 #include "path.h" 18 18 #include "pathspec.h" 19 19 #include "object-file.h" 20 - #include "object-store.h" 20 + #include "object-store-ll.h" 21 21 #include "hash-lookup.h" 22 22 #include "strmap.h" 23 23 #include "wrapper.h"
+1 -1
revision.c
··· 6 6 #include "hex.h" 7 7 #include "object-name.h" 8 8 #include "object-file.h" 9 - #include "object-store.h" 9 + #include "object-store-ll.h" 10 10 #include "tag.h" 11 11 #include "blob.h" 12 12 #include "tree.h"
+1 -1
send-pack.c
··· 5 5 #include "gettext.h" 6 6 #include "hex.h" 7 7 #include "refs.h" 8 - #include "object-store.h" 8 + #include "object-store-ll.h" 9 9 #include "pkt-line.h" 10 10 #include "sideband.h" 11 11 #include "run-command.h"
+1 -1
sequencer.c
··· 11 11 #include "dir.h" 12 12 #include "object-file.h" 13 13 #include "object-name.h" 14 - #include "object-store.h" 14 + #include "object-store-ll.h" 15 15 #include "object.h" 16 16 #include "pager.h" 17 17 #include "commit.h"
+1 -1
server-info.c
··· 11 11 #include "packfile.h" 12 12 #include "path.h" 13 13 #include "object-file.h" 14 - #include "object-store.h" 14 + #include "object-store-ll.h" 15 15 #include "server-info.h" 16 16 #include "strbuf.h" 17 17 #include "wrapper.h"
+1 -1
shallow.c
··· 4 4 #include "repository.h" 5 5 #include "tempfile.h" 6 6 #include "lockfile.h" 7 - #include "object-store.h" 7 + #include "object-store-ll.h" 8 8 #include "commit.h" 9 9 #include "tag.h" 10 10 #include "pkt-line.h"
+1 -1
streaming.c
··· 7 7 #include "streaming.h" 8 8 #include "repository.h" 9 9 #include "object-file.h" 10 - #include "object-store.h" 10 + #include "object-store-ll.h" 11 11 #include "replace-object.h" 12 12 #include "packfile.h" 13 13 #include "wrapper.h"
+1 -1
submodule-config.c
··· 11 11 #include "submodule.h" 12 12 #include "strbuf.h" 13 13 #include "object-name.h" 14 - #include "object-store.h" 14 + #include "object-store-ll.h" 15 15 #include "parse-options.h" 16 16 #include "thread-utils.h" 17 17 #include "tree-walk.h"
+1 -1
submodule.c
··· 27 27 #include "parse-options.h" 28 28 #include "object-file.h" 29 29 #include "object-name.h" 30 - #include "object-store.h" 30 + #include "object-store-ll.h" 31 31 #include "commit-reach.h" 32 32 #include "read-cache-ll.h" 33 33 #include "setup.h"
+1 -1
t/helper/test-pack-mtimes.c
··· 1 1 #include "test-tool.h" 2 2 #include "hex.h" 3 3 #include "strbuf.h" 4 - #include "object-store.h" 4 + #include "object-store-ll.h" 5 5 #include "packfile.h" 6 6 #include "pack-mtimes.h" 7 7 #include "setup.h"
+1 -1
t/helper/test-partial-clone.c
··· 1 1 #include "test-tool.h" 2 2 #include "hex.h" 3 3 #include "repository.h" 4 - #include "object-store.h" 4 + #include "object-store-ll.h" 5 5 #include "setup.h" 6 6 7 7 /*
+1 -1
t/helper/test-read-graph.c
··· 1 1 #include "test-tool.h" 2 2 #include "commit-graph.h" 3 3 #include "repository.h" 4 - #include "object-store.h" 4 + #include "object-store-ll.h" 5 5 #include "bloom.h" 6 6 #include "setup.h" 7 7
+1 -1
t/helper/test-read-midx.c
··· 2 2 #include "hex.h" 3 3 #include "midx.h" 4 4 #include "repository.h" 5 - #include "object-store.h" 5 + #include "object-store-ll.h" 6 6 #include "pack-bitmap.h" 7 7 #include "packfile.h" 8 8 #include "setup.h"
+2 -1
t/helper/test-ref-store.c
··· 3 3 #include "refs.h" 4 4 #include "setup.h" 5 5 #include "worktree.h" 6 - #include "object-store.h" 6 + #include "object-store-ll.h" 7 7 #include "path.h" 8 8 #include "repository.h" 9 + #include "strbuf.h" 9 10 #include "revision.h" 10 11 11 12 struct flag_definition {
+1 -1
t/helper/test-repository.c
··· 4 4 #include "config.h" 5 5 #include "environment.h" 6 6 #include "hex.h" 7 - #include "object-store.h" 7 + #include "object-store-ll.h" 8 8 #include "object.h" 9 9 #include "repository.h" 10 10 #include "setup.h"
+1 -1
tag.c
··· 2 2 #include "environment.h" 3 3 #include "tag.h" 4 4 #include "object-name.h" 5 - #include "object-store.h" 5 + #include "object-store-ll.h" 6 6 #include "commit.h" 7 7 #include "tree.h" 8 8 #include "blob.h"
+1 -1
tmp-objdir.c
··· 11 11 #include "strbuf.h" 12 12 #include "strvec.h" 13 13 #include "quote.h" 14 - #include "object-store.h" 14 + #include "object-store-ll.h" 15 15 16 16 struct tmp_objdir { 17 17 struct strbuf path;
+1 -1
transport.c
··· 27 27 #include "transport-internal.h" 28 28 #include "protocol.h" 29 29 #include "object-name.h" 30 - #include "object-store.h" 30 + #include "object-store-ll.h" 31 31 #include "color.h" 32 32 #include "bundle-uri.h" 33 33 #include "wrapper.h"
+1 -1
tree-walk.c
··· 5 5 #include "gettext.h" 6 6 #include "hex.h" 7 7 #include "object-file.h" 8 - #include "object-store.h" 8 + #include "object-store-ll.h" 9 9 #include "trace2.h" 10 10 #include "tree.h" 11 11 #include "pathspec.h"
+1 -1
tree.c
··· 3 3 #include "hex.h" 4 4 #include "tree.h" 5 5 #include "object-name.h" 6 - #include "object-store.h" 6 + #include "object-store-ll.h" 7 7 #include "blob.h" 8 8 #include "commit.h" 9 9 #include "tag.h"
+1 -1
unpack-trees.c
··· 23 23 #include "symlinks.h" 24 24 #include "trace2.h" 25 25 #include "fsmonitor.h" 26 - #include "object-store.h" 26 + #include "object-store-ll.h" 27 27 #include "promisor-remote.h" 28 28 #include "entry.h" 29 29 #include "parallel-checkout.h"
+1 -1
upload-pack.c
··· 7 7 #include "pkt-line.h" 8 8 #include "sideband.h" 9 9 #include "repository.h" 10 - #include "object-store.h" 10 + #include "object-store-ll.h" 11 11 #include "oid-array.h" 12 12 #include "tag.h" 13 13 #include "object.h"
+2 -1
walker.c
··· 3 3 #include "hex.h" 4 4 #include "walker.h" 5 5 #include "repository.h" 6 - #include "object-store.h" 6 + #include "object-store-ll.h" 7 7 #include "commit.h" 8 + #include "strbuf.h" 8 9 #include "tree.h" 9 10 #include "tree-walk.h" 10 11 #include "tag.h"
+2 -1
xdiff-interface.c
··· 1 1 #include "git-compat-util.h" 2 2 #include "config.h" 3 3 #include "hex.h" 4 - #include "object-store.h" 4 + #include "object-store-ll.h" 5 + #include "strbuf.h" 5 6 #include "xdiff-interface.h" 6 7 #include "xdiff/xtypes.h" 7 8 #include "xdiff/xdiffi.h"