Skip to content

Commit 451df79

Browse files
committed
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 parent a9f5762 commit 451df79

File tree

10 files changed

+11
-3
lines changed

10 files changed

+11
-3
lines changed

src/attr_file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "git2/tree.h"
1616
#include "blob.h"
1717
#include "index.h"
18+
#include "fnmatch.h"
1819
#include <ctype.h>
1920

2021
static void attr_file_free(git_attr_file *file)

src/config_file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "array.h"
1919
#include "config_parse.h"
2020
#include "config_entries.h"
21+
#include "fnmatch.h"
2122

2223
#include <ctype.h>
2324
#include <sys/types.h>

src/describe.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414

1515
#include "commit.h"
1616
#include "commit_list.h"
17+
#include "fnmatch.h"
1718
#include "oidmap.h"
1819
#include "refs.h"
20+
#include "repository.h"
1921
#include "revwalk.h"
2022
#include "tag.h"
2123
#include "vector.h"
22-
#include "repository.h"
2324

2425
/* Ported from https://github.com/git/git/blob/89dde7882f71f846ccd0359756d27bebc31108de/builtin/describe.c */
2526

src/pathspec.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "index.h"
1717
#include "bitvec.h"
1818
#include "diff.h"
19+
#include "fnmatch.h"
1920

2021
/* what is the common non-wildcard prefix for all items in the pathspec */
2122
char *git_pathspec_prefix(const git_strarray *pathspec)

src/posix.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include <fcntl.h>
1313
#include <time.h>
14-
#include "fnmatch.h"
1514

1615
/* stat: file mode type testing macros */
1716
#ifndef S_IFGITLINK

src/refdb_fs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "iterator.h"
1919
#include "sortedcache.h"
2020
#include "signature.h"
21+
#include "fnmatch.h"
2122

2223
#include <git2/tag.h>
2324
#include <git2/object.h>

src/refspec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "git2/errors.h"
1111

1212
#include "util.h"
13-
#include "posix.h"
13+
#include "fnmatch.h"
1414
#include "refs.h"
1515
#include "vector.h"
1616

src/status.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "repository.h"
1717
#include "ignore.h"
1818
#include "index.h"
19+
#include "fnmatch.h"
1920

2021
#include "git2/diff.h"
2122
#include "diff.h"

src/tag.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "tag.h"
99

1010
#include "commit.h"
11+
#include "fnmatch.h"
1112
#include "signature.h"
1213
#include "message.h"
1314
#include "git2/object.h"

tests/describe/describe_helpers.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "describe_helpers.h"
22

3+
#include "fnmatch.h"
4+
35
void assert_describe(
46
const char *expected_output,
57
const char *revparse_spec,

0 commit comments

Comments
 (0)