Skip to content

Commit 15db4e7

Browse files
newrengitster
authored andcommitted
treewide: remove unnecessary cache.h includes in source files
We had several C files include cache.h unnecessarily. Replace those with an include of "git-compat-util.h" instead. Much like the previous commit, these have all been verified via both ensuring that gcc -E $SOURCE_FILE | grep '"cache.h"' found no hits and that make DEVELOPER=1 ${OBJECT_FILE_FOR_SOURCE_FILE} successfully compiles without warnings. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ba3d1c7 commit 15db4e7

29 files changed

+25
-30
lines changed

hashmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Generic implementation of hash-based key value mappings.
33
*/
4-
#include "cache.h"
4+
#include "git-compat-util.h"
55
#include "hashmap.h"
66

77
#define FNV32_BASE ((unsigned int) 0x811c9dc5)

imap-send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* along with this program; if not, see <http://www.gnu.org/licenses/>.
2222
*/
2323

24-
#include "cache.h"
24+
#include "git-compat-util.h"
2525
#include "config.h"
2626
#include "credential.h"
2727
#include "exec-cmd.h"

json-writer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "json-writer.h"
33

44
void jw_init(struct json_writer *jw)

kwset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
String Matching: An Aid to Bibliographic Search," CACM June 1975,
3333
Vol. 18, No. 6, which describes the failure function used below. */
3434

35-
#include "cache.h"
35+
#include "git-compat-util.h"
3636

3737
#include "kwset.h"
3838
#include "compat/obstack.h"

levenshtein.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "levenshtein.h"
33

44
/*

linear-assignment.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* algorithm for dense and sparse linear assignment problems</i>. Computing,
44
* 38(4), 325-340.
55
*/
6-
#include "cache.h"
6+
#include "git-compat-util.h"
77
#include "linear-assignment.h"
88

99
#define COST(column, row) cost[(column) + column_count * (row)]

mem-pool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Memory Pool implementation logic.
33
*/
44

5-
#include "cache.h"
5+
#include "git-compat-util.h"
66
#include "mem-pool.h"
77

88
#define BLOCK_GROWTH_SIZE (1024 * 1024 - sizeof(struct mp_block))

oidmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "oidmap.h"
33

44
static int oidmap_neq(const void *hashmap_cmp_fn_data UNUSED,

repo-settings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "config.h"
33
#include "repository.h"
44
#include "midx.h"

serve.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "repository.h"
33
#include "config.h"
44
#include "pkt-line.h"
@@ -8,6 +8,7 @@
88
#include "serve.h"
99
#include "upload-pack.h"
1010
#include "bundle-uri.h"
11+
#include "trace2.h"
1112

1213
static int advertise_sid = -1;
1314
static int client_hash_algo = GIT_HASH_SHA1;

shell.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "quote.h"
33
#include "exec-cmd.h"
44
#include "strbuf.h"

t/helper/test-crontab.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "test-tool.h"
2-
#include "cache.h"
32

43
/*
54
* Usage: test-tool crontab <file> -l|<input>

t/helper/test-ctype.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "test-tool.h"
2-
#include "cache.h"
32

43
static int rc;
54

t/helper/test-json-writer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "test-tool.h"
2-
#include "cache.h"
32
#include "json-writer.h"
43

54
static const char *expect_obj1 = "{\"a\":\"abc\",\"b\":42,\"c\":true}";

t/helper/test-pcre2-config.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "test-tool.h"
2-
#include "cache.h"
32
#include "grep.h"
43

54
int cmd__pcre2_config(int argc, const char **argv)

t/helper/test-prio-queue.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "test-tool.h"
2-
#include "cache.h"
32
#include "prio-queue.h"
43

54
static int intcmp(const void *va, const void *vb, void *data)

t/helper/test-run-command.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
*/
1010

1111
#include "test-tool.h"
12-
#include "git-compat-util.h"
13-
#include "cache.h"
1412
#include "run-command.h"
1513
#include "strvec.h"
1614
#include "strbuf.h"

t/helper/test-sigchain.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "test-tool.h"
2-
#include "cache.h"
32
#include "sigchain.h"
43

54
#define X(f) \

t/helper/test-simple-ipc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
*/
44

55
#include "test-tool.h"
6-
#include "cache.h"
6+
#include "gettext.h"
77
#include "strbuf.h"
88
#include "simple-ipc.h"
99
#include "parse-options.h"
1010
#include "thread-utils.h"
1111
#include "strvec.h"
1212
#include "run-command.h"
13+
#include "trace2.h"
1314

1415
#ifndef SUPPORTS_SIMPLE_IPC
1516
int cmd__simple_ipc(int argc, const char **argv)

t/helper/test-wildmatch.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "test-tool.h"
2-
#include "cache.h"
32

43
int cmd__wildmatch(int argc, const char **argv)
54
{

thread-utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "thread-utils.h"
33

44
#if defined(hpux) || defined(__hpux) || defined(_hpux)

trace2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "config.h"
33
#include "json-writer.h"
44
#include "quote.h"
55
#include "run-command.h"
66
#include "sigchain.h"
77
#include "thread-utils.h"
88
#include "version.h"
9+
#include "trace.h"
910
#include "trace2/tr2_cfg.h"
1011
#include "trace2/tr2_cmd_name.h"
1112
#include "trace2/tr2_ctr.h"

trace2/tr2_ctr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "thread-utils.h"
33
#include "trace2/tr2_tgt.h"
44
#include "trace2/tr2_tls.h"

trace2/tr2_tbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "tr2_tbuf.h"
33

44
void tr2_tbuf_local_time(struct tr2_tbuf *tb)

trace2/tr2_tgt_event.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "config.h"
33
#include "json-writer.h"
44
#include "run-command.h"

trace2/tr2_tgt_normal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "config.h"
33
#include "run-command.h"
44
#include "quote.h"

trace2/tr2_tgt_perf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "config.h"
33
#include "run-command.h"
44
#include "quote.h"

trace2/tr2_tmr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "thread-utils.h"
33
#include "trace2/tr2_tgt.h"
44
#include "trace2/tr2_tls.h"
55
#include "trace2/tr2_tmr.h"
6+
#include "trace.h"
67

78
#define MY_MAX(a, b) ((a) > (b) ? (a) : (b))
89
#define MY_MIN(a, b) ((a) < (b) ? (a) : (b))

unix-stream-server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "lockfile.h"
33
#include "unix-socket.h"
44
#include "unix-stream-server.h"

0 commit comments

Comments
 (0)