Skip to content

Commit d1cbe1e

Browse files
newrengitster
authored andcommitted
hash-ll.h: split out of hash.h to remove dependency on repository.h
hash.h depends upon and includes repository.h, due to the definition and use of the_hash_algo (defined as the_repository->hash_algo). However, most headers trying to include hash.h are only interested in the layout of the structs like object_id. Move the parts of hash.h that do not depend upon repository.h into a new file hash-ll.h (the "low level" parts of hash.h), and adjust other files to use this new header where the convenience inline functions aren't needed. This allows hash.h and object.h to be fairly small, minimal headers. It also exposes a lot of hidden dependencies on both path.h (which was brought in by repository.h) and repository.h (which was previously implicitly brought in by object.h), so also adjust other files to be more explicit about what they depend upon. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 23a517e commit d1cbe1e

File tree

109 files changed

+398
-292
lines changed

Some content is hidden

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

109 files changed

+398
-292
lines changed

alloc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "blob.h"
1414
#include "tree.h"
1515
#include "commit.h"
16+
#include "repository.h"
1617
#include "tag.h"
1718
#include "alloc.h"
1819

apply.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef APPLY_H
22
#define APPLY_H
33

4-
#include "hash.h"
4+
#include "hash-ll.h"
55
#include "lockfile.h"
66
#include "string-list.h"
77
#include "strmap.h"

branch.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "refs.h"
1010
#include "refspec.h"
1111
#include "remote.h"
12+
#include "repository.h"
1213
#include "sequencer.h"
1314
#include "commit.h"
1415
#include "worktree.h"

builtin/apply.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "builtin.h"
33
#include "gettext.h"
44
#include "parse-options.h"
5+
#include "repository.h"
56
#include "apply.h"
67

78
static const char * const apply_usage[] = {

builtin/archive.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "transport.h"
1010
#include "parse-options.h"
1111
#include "pkt-line.h"
12+
#include "repository.h"
1213
#include "sideband.h"
1314

1415
static void create_output_file(const char *output_file)

builtin/bundle.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "strvec.h"
66
#include "parse-options.h"
77
#include "pkt-line.h"
8+
#include "repository.h"
89
#include "cache.h"
910
#include "bundle.h"
1011

builtin/check-attr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "gettext.h"
88
#include "object-name.h"
99
#include "quote.h"
10+
#include "repository.h"
1011
#include "setup.h"
1112
#include "parse-options.h"
1213
#include "write-or-die.h"

builtin/check-ignore.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 "pathspec.h"
99
#include "parse-options.h"
10+
#include "repository.h"
1011
#include "submodule.h"
1112
#include "write-or-die.h"
1213

builtin/checkout-index.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "gettext.h"
1212
#include "lockfile.h"
1313
#include "quote.h"
14+
#include "repository.h"
1415
#include "cache-tree.h"
1516
#include "parse-options.h"
1617
#include "entry.h"

builtin/clean.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "dir.h"
1515
#include "gettext.h"
1616
#include "parse-options.h"
17+
#include "repository.h"
1718
#include "setup.h"
1819
#include "string-list.h"
1920
#include "quote.h"

0 commit comments

Comments
 (0)