git-compat-util.h: remove unneccessary include of wildmatch.h

The include of wildmatch.h in git-compat-util.h was added in cebcab189aa (Makefile: add USE_WILDMATCH to use wildmatch as fnmatch, 2013-01-01) as a way to be able to compile-time force any calls to fnmatch() to instead invoke wildmatch(). The defines and inline function were removed in 70a8fc999d9 (stop using fnmatch (either native or compat), 2014-02-15), and this include in git-compat-util.h has been unnecessary ever since. Remove the include from git-compat-util.h, but add it to the .c files that had omitted the direct #include they needed. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed May 16, 2023 at 06:34 UTC dd77d587954bd798d0ea6b26f0815ed2d78d47b9
17 files changed +16 -2
apply.c
+1
@@ -35,6 +35,7 @@
35 #include "entry.h"
36 #include "setup.h"
37 #include "symlinks.h"
38 +#include "wildmatch.h"
39 #include "ws.h"
40 #include "wrapper.h"
41
builtin/describe.c
+1
@@ -22,6 +22,7 @@
22 #include "object-store.h"
23 #include "list-objects.h"
24 #include "commit-slab.h"
25 +#include "wildmatch.h"
26
27 #define MAX_TAGS (FLAG_BITS - 1)
28
builtin/ls-remote.c
+1
@@ -7,6 +7,7 @@
7 #include "remote.h"
8 #include "refs.h"
9 #include "parse-options.h"
10 +#include "wildmatch.h"
11
12 static const char * const ls_remote_usage[] = {
13 N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
builtin/name-rev.c
+1
@@ -15,6 +15,7 @@
15 #include "hash-lookup.h"
16 #include "commit-slab.h"
17 #include "commit-graph.h"
18 +#include "wildmatch.h"
19
20 /*
21 * One day. See the 'name a rev shortly after epoch' test in t6120 when
builtin/reflog.c
+1
@@ -4,6 +4,7 @@
4 #include "repository.h"
5 #include "revision.h"
6 #include "reachable.h"
7 +#include "wildmatch.h"
8 #include "worktree.h"
9 #include "reflog.h"
10 #include "parse-options.h"
builtin/replace.c
+1
@@ -24,6 +24,7 @@
24 #include "replace-object.h"
25 #include "repository.h"
26 #include "tag.h"
27 +#include "wildmatch.h"
28
29 static const char * const git_replace_usage[] = {
30 N_("git replace [-f] <object> <replacement>"),
builtin/show-branch.c
+1
@@ -14,6 +14,7 @@
14 #include "dir.h"
15 #include "commit-slab.h"
16 #include "date.h"
17 +#include "wildmatch.h"
18
19 static const char* show_branch_usage[] = {
20 N_("git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
config.c
+1
@@ -36,6 +36,7 @@
36 #include "setup.h"
37 #include "strvec.h"
38 #include "trace2.h"
39 +#include "wildmatch.h"
40 #include "worktree.h"
41 #include "ws.h"
42 #include "wrapper.h"
diffcore-order.c
+1
@@ -5,6 +5,7 @@
5 #include "gettext.h"
6 #include "diff.h"
7 #include "diffcore.h"
8 +#include "wildmatch.h"
9
10 static char **order;
11 static int order_cnt;
fmt-merge-msg.c
+1
@@ -15,6 +15,7 @@
15 #include "fmt-merge-msg.h"
16 #include "commit-reach.h"
17 #include "gpg-interface.h"
18 +#include "wildmatch.h"
19
20 static int use_branch_desc;
21 static int suppress_dest_pattern_seen;
git-compat-util.h
-2
@@ -625,8 +625,6 @@ static inline int git_has_dir_sep(const char *path)
625
626 #include "compat/bswap.h"
627
628 -#include "wildmatch.h"
629 -
628 struct strbuf;
629
630 /* General helper functions */
log-tree.c
+1
@@ -26,6 +26,7 @@
26 #include "range-diff.h"
27 #include "strmap.h"
28 #include "tree.h"
29 +#include "wildmatch.h"
30 #include "write-or-die.h"
31
32 static struct decoration name_decoration = { "object names" };
pathspec.c
+1
@@ -12,6 +12,7 @@
12 #include "strvec.h"
13 #include "symlinks.h"
14 #include "quote.h"
15 +#include "wildmatch.h"
16
17 /*
18 * Finds which of the given pathspecs match items in the index.
refs.c
+1
@@ -29,6 +29,7 @@
29 #include "sigchain.h"
30 #include "date.h"
31 #include "commit.h"
32 +#include "wildmatch.h"
33 #include "wrapper.h"
34
35 /*
revision.c
+1
@@ -46,6 +46,7 @@
46 #include "list-objects-filter-options.h"
47 #include "resolve-undo.h"
48 #include "parse-options.h"
49 +#include "wildmatch.h"
50
51 volatile show_early_output_fn_t show_early_output;
52
t/helper/test-wildmatch.c
+1
@@ -1,4 +1,5 @@
1 #include "test-tool.h"
2 +#include "wildmatch.h"
3
4 int cmd__wildmatch(int argc, const char **argv)
5 {
trace2/tr2_cfg.c
+1
@@ -4,6 +4,7 @@
4 #include "trace2.h"
5 #include "trace2/tr2_cfg.h"
6 #include "trace2/tr2_sysenv.h"
7 +#include "wildmatch.h"
8
9 static struct strbuf **tr2_cfg_patterns;
10 static int tr2_cfg_count_patterns;