]> git.ipfire.org Git - thirdparty/git.git/blame - t/helper/test-wildmatch.c
treewide: remove unnecessary cache.h includes in source files
[thirdparty/git.git] / t / helper / test-wildmatch.c
CommitLineData
0489289d 1#include "test-tool.h"
feabcc17 2
0489289d 3int cmd__wildmatch(int argc, const char **argv)
feabcc17 4{
ef49841d
NTND
5 int i;
6 for (i = 2; i < argc; i++) {
7 if (argv[i][0] == '/')
8 die("Forward slash is not allowed at the beginning of the\n"
9 "pattern because Windows does not like it. Use `XXX/' instead.");
10 else if (!strncmp(argv[i], "XXX/", 4))
11 argv[i] += 3;
12 }
feabcc17 13 if (!strcmp(argv[1], "wildmatch"))
55d34269 14 return !!wildmatch(argv[3], argv[2], WM_PATHNAME);
feabcc17 15 else if (!strcmp(argv[1], "iwildmatch"))
55d34269 16 return !!wildmatch(argv[3], argv[2], WM_PATHNAME | WM_CASEFOLD);
c41244e7 17 else if (!strcmp(argv[1], "pathmatch"))
55d34269 18 return !!wildmatch(argv[3], argv[2], 0);
91061c44
ÆAB
19 else if (!strcmp(argv[1], "ipathmatch"))
20 return !!wildmatch(argv[3], argv[2], WM_CASEFOLD);
feabcc17
NTND
21 else
22 return 1;
23}