Skip to content

Commit cbd53a2

Browse files
stefanbellergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 14ba97f commit cbd53a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+198
-117
lines changed

apply.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "cache.h"
1111
#include "config.h"
12+
#include "object-store.h"
1213
#include "blob.h"
1314
#include "delta.h"
1415
#include "diff.h"

archive-tar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "config.h"
66
#include "tar.h"
77
#include "archive.h"
8+
#include "object-store.h"
89
#include "streaming.h"
910
#include "run-command.h"
1011

archive-zip.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "archive.h"
77
#include "streaming.h"
88
#include "utf8.h"
9+
#include "object-store.h"
910
#include "userdiff.h"
1011
#include "xdiff-interface.h"
1112

archive.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "cache.h"
22
#include "config.h"
33
#include "refs.h"
4+
#include "object-store.h"
45
#include "commit.h"
56
#include "tree-walk.h"
67
#include "attr.h"

blame.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "cache.h"
22
#include "refs.h"
3+
#include "object-store.h"
34
#include "cache-tree.h"
45
#include "mergesort.h"
56
#include "diff.h"

builtin/blame.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "line-log.h"
2323
#include "dir.h"
2424
#include "progress.h"
25+
#include "object-store.h"
2526
#include "blame.h"
2627

2728
static char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>");

builtin/cat-file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "tree-walk.h"
1414
#include "sha1-array.h"
1515
#include "packfile.h"
16+
#include "object-store.h"
1617

1718
struct batch_options {
1819
int enabled;

builtin/checkout.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "lockfile.h"
55
#include "parse-options.h"
66
#include "refs.h"
7+
#include "object-store.h"
78
#include "commit.h"
89
#include "tree.h"
910
#include "tree-walk.h"

builtin/clone.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "parse-options.h"
1515
#include "fetch-pack.h"
1616
#include "refs.h"
17+
#include "object-store.h"
1718
#include "tree.h"
1819
#include "tree-walk.h"
1920
#include "unpack-trees.h"

builtin/commit-tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
#include "cache.h"
77
#include "config.h"
8+
#include "object-store.h"
89
#include "commit.h"
910
#include "tree.h"
1011
#include "builtin.h"

builtin/describe.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "hashmap.h"
1414
#include "argv-array.h"
1515
#include "run-command.h"
16+
#include "object-store.h"
1617
#include "revision.h"
1718
#include "list-objects.h"
1819

builtin/difftool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "argv-array.h"
2121
#include "strbuf.h"
2222
#include "lockfile.h"
23+
#include "object-store.h"
2324
#include "dir.h"
2425

2526
static char *diff_gui_tool;

builtin/fast-export.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "cache.h"
88
#include "config.h"
99
#include "refs.h"
10+
#include "object-store.h"
1011
#include "commit.h"
1112
#include "object.h"
1213
#include "tag.h"

builtin/fetch.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "config.h"
66
#include "repository.h"
77
#include "refs.h"
8+
#include "object-store.h"
89
#include "commit.h"
910
#include "builtin.h"
1011
#include "string-list.h"

builtin/fmt-merge-msg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "cache.h"
33
#include "config.h"
44
#include "refs.h"
5+
#include "object-store.h"
56
#include "commit.h"
67
#include "diff.h"
78
#include "revision.h"

builtin/hash-object.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77
#include "builtin.h"
88
#include "config.h"
9+
#include "object-store.h"
910
#include "blob.h"
1011
#include "quote.h"
1112
#include "parse-options.h"

builtin/log.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "cache.h"
88
#include "config.h"
99
#include "refs.h"
10+
#include "object-store.h"
1011
#include "color.h"
1112
#include "commit.h"
1213
#include "diff.h"

builtin/ls-tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
#include "cache.h"
77
#include "config.h"
8+
#include "object-store.h"
89
#include "blob.h"
910
#include "tree.h"
1011
#include "commit.h"

builtin/merge-tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "builtin.h"
22
#include "tree-walk.h"
33
#include "xdiff-interface.h"
4+
#include "object-store.h"
45
#include "blob.h"
56
#include "exec_cmd.h"
67
#include "merge-blobs.h"

builtin/mktag.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "builtin.h"
22
#include "tag.h"
33
#include "replace-object.h"
4+
#include "object-store.h"
45

56
/*
67
* A signature file has a very simple fixed format: four lines

builtin/mktree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "quote.h"
88
#include "tree.h"
99
#include "parse-options.h"
10+
#include "object-store.h"
1011

1112
static struct treeent {
1213
unsigned mode;

builtin/notes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "config.h"
1212
#include "builtin.h"
1313
#include "notes.h"
14+
#include "object-store.h"
1415
#include "blob.h"
1516
#include "pretty.h"
1617
#include "refs.h"

builtin/prune.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "reachable.h"
77
#include "parse-options.h"
88
#include "progress.h"
9+
#include "object-store.h"
910

1011
static const char * const prune_usage[] = {
1112
N_("git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"),

builtin/receive-pack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "tmp-objdir.h"
2626
#include "oidset.h"
2727
#include "packfile.h"
28+
#include "object-store.h"
2829
#include "protocol.h"
2930

3031
static const char * const receive_pack_usage[] = {

builtin/reflog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "builtin.h"
22
#include "config.h"
33
#include "lockfile.h"
4+
#include "object-store.h"
45
#include "commit.h"
56
#include "refs.h"
67
#include "dir.h"

builtin/remote.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "strbuf.h"
88
#include "run-command.h"
99
#include "refs.h"
10+
#include "object-store.h"
1011
#include "argv-array.h"
1112

1213
static const char * const builtin_remote_usage[] = {

builtin/rev-list.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "list-objects.h"
77
#include "list-objects-filter.h"
88
#include "list-objects-filter-options.h"
9+
#include "object-store.h"
910
#include "pack.h"
1011
#include "pack-bitmap.h"
1112
#include "builtin.h"

builtin/show-ref.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "builtin.h"
22
#include "cache.h"
33
#include "refs.h"
4+
#include "object-store.h"
45
#include "object.h"
56
#include "tag.h"
67
#include "string-list.h"

builtin/tag.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "config.h"
1111
#include "builtin.h"
1212
#include "refs.h"
13+
#include "object-store.h"
1314
#include "tag.h"
1415
#include "run-command.h"
1516
#include "parse-options.h"

builtin/unpack-file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "builtin.h"
22
#include "config.h"
3+
#include "object-store.h"
34

45
static char *create_temp_file(struct object_id *oid)
56
{

builtin/unpack-objects.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "builtin.h"
22
#include "cache.h"
33
#include "config.h"
4+
#include "object-store.h"
45
#include "object.h"
56
#include "delta.h"
67
#include "pack.h"

builtin/verify-commit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "cache.h"
99
#include "config.h"
1010
#include "builtin.h"
11+
#include "object-store.h"
1112
#include "commit.h"
1213
#include "run-command.h"
1314
#include <signal.h>

bulk-checkin.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "pack.h"
99
#include "strbuf.h"
1010
#include "packfile.h"
11+
#include "object-store.h"
1112

1213
static struct bulk_checkin_state {
1314
unsigned plugged:1;

bundle.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "cache.h"
22
#include "lockfile.h"
33
#include "bundle.h"
4+
#include "object-store.h"
45
#include "object.h"
56
#include "commit.h"
67
#include "diff.h"

cache-tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "tree.h"
44
#include "tree-walk.h"
55
#include "cache-tree.h"
6+
#include "object-store.h"
67

78
#ifndef DEBUG
89
#define DEBUG 0

0 commit comments

Comments
 (0)