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 <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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"

0 commit comments

Comments
 (0)