posix: remove implicit include of "fnmatch.h" We're about to phase out our bundled fnmatch implementation as git.git has moved to wildmatch long ago in 2014. To make it easier to spot which files are stilll using fnmatch, remove the implicit "fnmatch.h" include in "posix.h" and instead include it explicitly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
diff --git a/src/attr_file.c b/src/attr_file.c
index f01a743..a2959ae 100644
--- a/src/attr_file.c
+++ b/src/attr_file.c
@@ -15,6 +15,7 @@
#include "git2/tree.h"
#include "blob.h"
#include "index.h"
+#include "fnmatch.h"
#include <ctype.h>
static void attr_file_free(git_attr_file *file)
diff --git a/src/config_file.c b/src/config_file.c
index 7162058..958a163 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -18,6 +18,7 @@
#include "array.h"
#include "config_parse.h"
#include "config_entries.h"
+#include "fnmatch.h"
#include <ctype.h>
#include <sys/types.h>
diff --git a/src/describe.c b/src/describe.c
index 7f71519..1354290 100644
--- a/src/describe.c
+++ b/src/describe.c
@@ -14,12 +14,13 @@
#include "commit.h"
#include "commit_list.h"
+#include "fnmatch.h"
#include "oidmap.h"
#include "refs.h"
+#include "repository.h"
#include "revwalk.h"
#include "tag.h"
#include "vector.h"
-#include "repository.h"
/* Ported from https://github.com/git/git/blob/89dde7882f71f846ccd0359756d27bebc31108de/builtin/describe.c */
diff --git a/src/pathspec.c b/src/pathspec.c
index 07795f2..80144c7 100644
--- a/src/pathspec.c
+++ b/src/pathspec.c
@@ -16,6 +16,7 @@
#include "index.h"
#include "bitvec.h"
#include "diff.h"
+#include "fnmatch.h"
/* what is the common non-wildcard prefix for all items in the pathspec */
char *git_pathspec_prefix(const git_strarray *pathspec)
diff --git a/src/posix.h b/src/posix.h
index 0119b6b..2296666 100644
--- a/src/posix.h
+++ b/src/posix.h
@@ -11,7 +11,6 @@
#include <fcntl.h>
#include <time.h>
-#include "fnmatch.h"
/* stat: file mode type testing macros */
#ifndef S_IFGITLINK
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index c8533e6..22b08a1 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -18,6 +18,7 @@
#include "iterator.h"
#include "sortedcache.h"
#include "signature.h"
+#include "fnmatch.h"
#include <git2/tag.h>
#include <git2/object.h>
diff --git a/src/refspec.c b/src/refspec.c
index dab0536..30e618f 100644
--- a/src/refspec.c
+++ b/src/refspec.c
@@ -10,7 +10,7 @@
#include "git2/errors.h"
#include "util.h"
-#include "posix.h"
+#include "fnmatch.h"
#include "refs.h"
#include "vector.h"
diff --git a/src/status.c b/src/status.c
index 8d3185f..84c4b66 100644
--- a/src/status.c
+++ b/src/status.c
@@ -16,6 +16,7 @@
#include "repository.h"
#include "ignore.h"
#include "index.h"
+#include "fnmatch.h"
#include "git2/diff.h"
#include "diff.h"
diff --git a/src/tag.c b/src/tag.c
index b4a5015..e39a79c 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -8,6 +8,7 @@
#include "tag.h"
#include "commit.h"
+#include "fnmatch.h"
#include "signature.h"
#include "message.h"
#include "git2/object.h"
diff --git a/tests/describe/describe_helpers.c b/tests/describe/describe_helpers.c
index 2e6ad53..e8e887c 100644
--- a/tests/describe/describe_helpers.c
+++ b/tests/describe/describe_helpers.c
@@ -1,5 +1,7 @@
#include "describe_helpers.h"
+#include "fnmatch.h"
+
void assert_describe(
const char *expected_output,
const char *revparse_spec,