diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-03-18 00:03:08 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-03-18 00:03:09 +0300 |
commit | 88cc8ed8bc7d4bc9521b426e95ae2a38d3aec13a (patch) | |
tree | 856c32df7cde0ad5322804cddddc5ab09d3128e6 /t | |
parent | f17d232f14135c9cce6e043389a9b7c434443606 (diff) | |
parent | f524970185963a180ecf3a750a31405c4d0de484 (diff) |
Merge branch 'en/header-cleanup'
Code clean-up to clarify the rule that "git-compat-util.h" must be
the first to be included.
* en/header-cleanup:
diff.h: remove unnecessary include of object.h
Remove unnecessary includes of builtin.h
treewide: replace cache.h with more direct headers, where possible
replace-object.h: move read_replace_refs declaration from cache.h to here
object-store.h: move struct object_info from cache.h
dir.h: refactor to no longer need to include cache.h
object.h: stop depending on cache.h; make cache.h depend on object.h
ident.h: move ident-related declarations out of cache.h
pretty.h: move has_non_ascii() declaration from commit.h
cache.h: remove dependence on hex.h; make other files include it explicitly
hex.h: move some hex-related declarations from cache.h
hash.h: move some oid-related declarations from cache.h
alloc.h: move ALLOC_GROW() functions from cache.h
treewide: remove unnecessary cache.h includes in source files
treewide: remove unnecessary cache.h includes
treewide: remove unnecessary git-compat-util.h includes in headers
treewide: ensure one of the appropriate headers is sourced first
Diffstat (limited to 't')
29 files changed, 24 insertions, 13 deletions
diff --git a/t/helper/test-bloom.c b/t/helper/test-bloom.c index 6c900ca668..127f134a2a 100644 --- a/t/helper/test-bloom.c +++ b/t/helper/test-bloom.c @@ -1,5 +1,6 @@ -#include "git-compat-util.h" +#include "cache.h" #include "bloom.h" +#include "hex.h" #include "test-tool.h" #include "commit.h" diff --git a/t/helper/test-cache-tree.c b/t/helper/test-cache-tree.c index 9159a17301..615e648e55 100644 --- a/t/helper/test-cache-tree.c +++ b/t/helper/test-cache-tree.c @@ -1,6 +1,7 @@ #define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" +#include "hex.h" #include "tree.h" #include "cache-tree.h" #include "parse-options.h" diff --git a/t/helper/test-crontab.c b/t/helper/test-crontab.c index e6c1b1e22b..597027a96e 100644 --- a/t/helper/test-crontab.c +++ b/t/helper/test-crontab.c @@ -1,5 +1,4 @@ #include "test-tool.h" -#include "cache.h" /* * Usage: test-tool crontab <file> -l|<input> diff --git a/t/helper/test-ctype.c b/t/helper/test-ctype.c index b21bd672d9..534ca66441 100644 --- a/t/helper/test-ctype.c +++ b/t/helper/test-ctype.c @@ -1,5 +1,4 @@ #include "test-tool.h" -#include "cache.h" static int rc; diff --git a/t/helper/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c index 454f17b1a0..92dfc1aa8c 100644 --- a/t/helper/test-dump-cache-tree.c +++ b/t/helper/test-dump-cache-tree.c @@ -1,6 +1,7 @@ #define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" +#include "hex.h" #include "tree.h" #include "cache-tree.h" diff --git a/t/helper/test-dump-split-index.c b/t/helper/test-dump-split-index.c index 0ea97b8407..813d0a38fa 100644 --- a/t/helper/test-dump-split-index.c +++ b/t/helper/test-dump-split-index.c @@ -1,6 +1,7 @@ #define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" +#include "hex.h" #include "split-index.h" #include "ewah/ewok.h" diff --git a/t/helper/test-dump-untracked-cache.c b/t/helper/test-dump-untracked-cache.c index 6d53683f13..af953fabe8 100644 --- a/t/helper/test-dump-untracked-cache.c +++ b/t/helper/test-dump-untracked-cache.c @@ -2,6 +2,7 @@ #include "test-tool.h" #include "cache.h" #include "dir.h" +#include "hex.h" static int compare_untracked(const void *a_, const void *b_) { diff --git a/t/helper/test-example-decorate.c b/t/helper/test-example-decorate.c index b9d1200eb9..7c7fc8efc1 100644 --- a/t/helper/test-example-decorate.c +++ b/t/helper/test-example-decorate.c @@ -1,5 +1,5 @@ #include "test-tool.h" -#include "cache.h" +#include "git-compat-util.h" #include "object.h" #include "decorate.h" diff --git a/t/helper/test-fast-rebase.c b/t/helper/test-fast-rebase.c index efc82dd80c..b1edb92a03 100644 --- a/t/helper/test-fast-rebase.c +++ b/t/helper/test-fast-rebase.c @@ -15,6 +15,7 @@ #include "cache-tree.h" #include "commit.h" +#include "hex.h" #include "lockfile.h" #include "merge-ort.h" #include "refs.h" diff --git a/t/helper/test-hash.c b/t/helper/test-hash.c index 5860dab0ff..016248106a 100644 --- a/t/helper/test-hash.c +++ b/t/helper/test-hash.c @@ -1,5 +1,6 @@ #include "test-tool.h" #include "cache.h" +#include "hex.h" int cmd_hash_impl(int ac, const char **av, int algo) { diff --git a/t/helper/test-json-writer.c b/t/helper/test-json-writer.c index 8c3edacc00..86887f5320 100644 --- a/t/helper/test-json-writer.c +++ b/t/helper/test-json-writer.c @@ -1,5 +1,4 @@ #include "test-tool.h" -#include "cache.h" #include "json-writer.h" static const char *expect_obj1 = "{\"a\":\"abc\",\"b\":42,\"c\":true}"; diff --git a/t/helper/test-match-trees.c b/t/helper/test-match-trees.c index 4079fdee06..04bc2563f3 100644 --- a/t/helper/test-match-trees.c +++ b/t/helper/test-match-trees.c @@ -1,5 +1,6 @@ #include "test-tool.h" #include "cache.h" +#include "hex.h" #include "tree.h" int cmd__match_trees(int ac, const char **av) diff --git a/t/helper/test-oid-array.c b/t/helper/test-oid-array.c index d1324d086a..0906993ad5 100644 --- a/t/helper/test-oid-array.c +++ b/t/helper/test-oid-array.c @@ -1,5 +1,6 @@ #include "test-tool.h" #include "cache.h" +#include "hex.h" #include "oid-array.h" static int print_oid(const struct object_id *oid, void *data) diff --git a/t/helper/test-oidmap.c b/t/helper/test-oidmap.c index 0acf99931e..883d40efd4 100644 --- a/t/helper/test-oidmap.c +++ b/t/helper/test-oidmap.c @@ -1,5 +1,6 @@ #include "test-tool.h" #include "cache.h" +#include "hex.h" #include "oidmap.h" #include "strbuf.h" diff --git a/t/helper/test-oidtree.c b/t/helper/test-oidtree.c index d48a409f4e..0b82431a70 100644 --- a/t/helper/test-oidtree.c +++ b/t/helper/test-oidtree.c @@ -1,5 +1,6 @@ #include "test-tool.h" #include "cache.h" +#include "hex.h" #include "oidtree.h" static enum cb_next print_oid(const struct object_id *oid, void *data) diff --git a/t/helper/test-pack-mtimes.c b/t/helper/test-pack-mtimes.c index f7b79daf4c..f68b3761b6 100644 --- a/t/helper/test-pack-mtimes.c +++ b/t/helper/test-pack-mtimes.c @@ -1,5 +1,6 @@ #include "git-compat-util.h" #include "test-tool.h" +#include "hex.h" #include "strbuf.h" #include "object-store.h" #include "packfile.h" diff --git a/t/helper/test-partial-clone.c b/t/helper/test-partial-clone.c index 3f102cfddd..da17fd37eb 100644 --- a/t/helper/test-partial-clone.c +++ b/t/helper/test-partial-clone.c @@ -1,4 +1,5 @@ #include "cache.h" +#include "hex.h" #include "test-tool.h" #include "repository.h" #include "object-store.h" diff --git a/t/helper/test-pcre2-config.c b/t/helper/test-pcre2-config.c index 5258fdddba..5d0b2a2e10 100644 --- a/t/helper/test-pcre2-config.c +++ b/t/helper/test-pcre2-config.c @@ -1,5 +1,4 @@ #include "test-tool.h" -#include "cache.h" #include "grep.h" int cmd__pcre2_config(int argc, const char **argv) diff --git a/t/helper/test-prio-queue.c b/t/helper/test-prio-queue.c index 133b5e6f4a..ac4c65d705 100644 --- a/t/helper/test-prio-queue.c +++ b/t/helper/test-prio-queue.c @@ -1,5 +1,4 @@ #include "test-tool.h" -#include "cache.h" #include "prio-queue.h" static int intcmp(const void *va, const void *vb, void *data) diff --git a/t/helper/test-proc-receive.c b/t/helper/test-proc-receive.c index a4b305f494..7e12d4f9aa 100644 --- a/t/helper/test-proc-receive.c +++ b/t/helper/test-proc-receive.c @@ -1,5 +1,6 @@ #include "cache.h" #include "connect.h" +#include "hex.h" #include "parse-options.h" #include "pkt-line.h" #include "sigchain.h" diff --git a/t/helper/test-reach.c b/t/helper/test-reach.c index 2f65c7f6a5..de8f26639d 100644 --- a/t/helper/test-reach.c +++ b/t/helper/test-reach.c @@ -1,8 +1,9 @@ #include "test-tool.h" -#include "cache.h" +#include "alloc.h" #include "commit.h" #include "commit-reach.h" #include "config.h" +#include "hex.h" #include "parse-options.h" #include "ref-filter.h" #include "string-list.h" diff --git a/t/helper/test-read-midx.c b/t/helper/test-read-midx.c index 27072ba94d..0a883cdf26 100644 --- a/t/helper/test-read-midx.c +++ b/t/helper/test-read-midx.c @@ -1,5 +1,6 @@ #include "test-tool.h" #include "cache.h" +#include "hex.h" #include "midx.h" #include "repository.h" #include "object-store.h" diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c index ae8a5648da..1745b088b7 100644 --- a/t/helper/test-ref-store.c +++ b/t/helper/test-ref-store.c @@ -1,5 +1,6 @@ #include "test-tool.h" #include "cache.h" +#include "hex.h" #include "refs.h" #include "worktree.h" #include "object-store.h" diff --git a/t/helper/test-repository.c b/t/helper/test-repository.c index 56f0e3c1be..10a6dfc216 100644 --- a/t/helper/test-repository.c +++ b/t/helper/test-repository.c @@ -3,6 +3,7 @@ #include "commit-graph.h" #include "commit.h" #include "config.h" +#include "hex.h" #include "object-store.h" #include "object.h" #include "repository.h" diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c index 3ecb830f4a..67b42ef50e 100644 --- a/t/helper/test-run-command.c +++ b/t/helper/test-run-command.c @@ -9,8 +9,6 @@ */ #include "test-tool.h" -#include "git-compat-util.h" -#include "cache.h" #include "run-command.h" #include "strvec.h" #include "strbuf.h" diff --git a/t/helper/test-sigchain.c b/t/helper/test-sigchain.c index d013bccdda..d1cf7377b7 100644 --- a/t/helper/test-sigchain.c +++ b/t/helper/test-sigchain.c @@ -1,5 +1,4 @@ #include "test-tool.h" -#include "cache.h" #include "sigchain.h" #define X(f) \ diff --git a/t/helper/test-simple-ipc.c b/t/helper/test-simple-ipc.c index 28365ff85b..3d1436da59 100644 --- a/t/helper/test-simple-ipc.c +++ b/t/helper/test-simple-ipc.c @@ -3,13 +3,14 @@ */ #include "test-tool.h" -#include "cache.h" +#include "gettext.h" #include "strbuf.h" #include "simple-ipc.h" #include "parse-options.h" #include "thread-utils.h" #include "strvec.h" #include "run-command.h" +#include "trace2.h" #ifndef SUPPORTS_SIMPLE_IPC int cmd__simple_ipc(int argc, const char **argv) diff --git a/t/helper/test-submodule-nested-repo-config.c b/t/helper/test-submodule-nested-repo-config.c index dc1c14bde3..a3848a8b66 100644 --- a/t/helper/test-submodule-nested-repo-config.c +++ b/t/helper/test-submodule-nested-repo-config.c @@ -1,4 +1,5 @@ #include "test-tool.h" +#include "cache.h" #include "submodule-config.h" static void die_usage(const char **argv, const char *msg) diff --git a/t/helper/test-wildmatch.c b/t/helper/test-wildmatch.c index 2c103d1824..a95bb4da9b 100644 --- a/t/helper/test-wildmatch.c +++ b/t/helper/test-wildmatch.c @@ -1,5 +1,4 @@ #include "test-tool.h" -#include "cache.h" int cmd__wildmatch(int argc, const char **argv) { |