Skip to content

Commit ba3d1c7

Browse files
newrengitster
authored andcommitted
treewide: remove unnecessary cache.h includes
We had several header files include cache.h unnecessarily. Remove those. These have all been verified via both ensuring that gcc -E $HEADER | grep '"cache.h"' found no hits and that cat >temp.c <<EOF && #include "git-compat-util.h" #include "$HEADER" int main() {} EOF gcc -c temp.c successfully compiles without warnings. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f332121 commit ba3d1c7

File tree

10 files changed

+7
-11
lines changed

10 files changed

+7
-11
lines changed

checkout.h

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

4-
#include "cache.h"
4+
#include "hash.h"
55

66
/*
77
* Check if the branch name uniquely matches a branch name on a remote

entry.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#ifndef ENTRY_H
22
#define ENTRY_H
33

4-
#include "cache.h"
54
#include "convert.h"
65

6+
struct cache_entry;
7+
struct index_state;
8+
79
struct checkout {
810
struct index_state *istate;
911
const char *base_dir;

khash.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#ifndef __AC_KHASH_H
2727
#define __AC_KHASH_H
2828

29-
#include "cache.h"
3029
#include "hashmap.h"
3130

3231
#define AC_VERSION_KHASH_H "0.2.8"

oidmap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef OIDMAP_H
22
#define OIDMAP_H
33

4-
#include "cache.h"
54
#include "hashmap.h"
65

76
/*

pretty.h

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

4-
#include "cache.h"
54
#include "date.h"
65
#include "string-list.h"
76

87
struct commit;
8+
struct repository;
99
struct strbuf;
1010
struct process_trailer_options;
1111

reflog-walk.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#ifndef REFLOG_WALK_H
22
#define REFLOG_WALK_H
33

4-
#include "cache.h"
5-
64
struct commit;
75
struct reflog_walk_info;
86
struct date_mode;

refs/refs-internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef REFS_REFS_INTERNAL_H
22
#define REFS_REFS_INTERNAL_H
33

4-
#include "cache.h"
54
#include "refs.h"
65
#include "iterator.h"
76

remote.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef REMOTE_H
22
#define REMOTE_H
33

4-
#include "cache.h"
54
#include "parse-options.h"
65
#include "hashmap.h"
76
#include "refspec.h"

sequencer.h

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

4-
#include "cache.h"
54
#include "strbuf.h"
65
#include "wt-status.h"
76

87
struct commit;
8+
struct index_state;
99
struct repository;
1010

1111
const char *git_path_commit_editmsg(void);

xdiff-interface.h

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

4-
#include "cache.h"
4+
#include "hash.h"
55
#include "xdiff/xdiff.h"
66

77
/*

0 commit comments

Comments
 (0)