treewide: remove unnecessary cache.h inclusion from several sources

A number of files were apparently including cache.h solely to get gettext.h. By making those files explicitly include gettext.h, we can already drop the include of cache.h in these files. On top of that, there were some files using cache.h that didn't need to for any reason. Remove these unnecessary includes. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Mar 21, 2023 at 06:25 UTC 4f6728d52d5dc79ce522e92171f984455c04b963
13 files changed +12 -13
compat/linux/procinfo.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "cache.h"
1 +#include "git-compat-util.h"
2
3 #include "strbuf.h"
4 #include "strvec.h"
compat/simple-ipc/ipc-shared.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "cache.h"
1 +#include "git-compat-util.h"
2 #include "simple-ipc.h"
3 #include "strbuf.h"
4 #include "pkt-line.h"
connected.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "cache.h"
1 +#include "git-compat-util.h"
2 #include "gettext.h"
3 #include "hex.h"
4 #include "object-store.h"
grep.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "cache.h"
1 +#include "git-compat-util.h"
2 #include "config.h"
3 #include "gettext.h"
4 #include "grep.h"
negotiator/default.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "cache.h"
1 +#include "git-compat-util.h"
2 #include "default.h"
3 #include "../commit.h"
4 #include "../fetch-negotiator.h"
negotiator/skipping.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "cache.h"
1 +#include "git-compat-util.h"
2 #include "skipping.h"
3 #include "../commit.h"
4 #include "../fetch-negotiator.h"
notes-cache.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "cache.h"
1 +#include "git-compat-util.h"
2 #include "notes-cache.h"
3 #include "object-store.h"
4 #include "repository.h"
patch-ids.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "cache.h"
1 +#include "git-compat-util.h"
2 #include "diff.h"
3 #include "commit.h"
4 #include "hash-lookup.h"
reflog.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "cache.h"
1 +#include "git-compat-util.h"
2 #include "gettext.h"
3 #include "object-store.h"
4 #include "reflog.h"
refs/iterator.c
+1 -1
@@ -3,7 +3,7 @@
3 * documentation about the design and use of reference iterators.
4 */
5
6 -#include "cache.h"
6 +#include "git-compat-util.h"
7 #include "refs.h"
8 #include "refs/refs-internal.h"
9 #include "iterator.h"
replace-object.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "cache.h"
1 +#include "git-compat-util.h"
2 #include "gettext.h"
3 #include "hex.h"
4 #include "oidmap.h"
t/helper/test-hash.c
-1
@@ -1,5 +1,4 @@
1 #include "test-tool.h"
2 -#include "cache.h"
2 #include "hex.h"
3
4 int cmd_hash_impl(int ac, const char **av, int algo)
xdiff-interface.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "cache.h"
1 +#include "git-compat-util.h"
2 #include "config.h"
3 #include "hex.h"
4 #include "object-store.h"