aboutsummaryrefslogtreecommitdiff
path: root/test-wildmatch.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-10-15 13:25:55 +0700
committerJunio C Hamano <gitster@pobox.com>2012-10-15 14:58:17 -0700
commitfeabcc173b7a5f55c2b1ec78f230276c63ae4d36 (patch)
tree54d1d16fa85bcd0a76b7099bf2a12139f82fb994 /test-wildmatch.c
parent327f2f3ebb2310653e78244293f6f34b28571142 (diff)
downloadgit-feabcc173b7a5f55c2b1ec78f230276c63ae4d36.tar.gz
git-feabcc173b7a5f55c2b1ec78f230276c63ae4d36.tar.xz
Integrate wildmatch to git
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-wildmatch.c')
-rw-r--r--test-wildmatch.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test-wildmatch.c b/test-wildmatch.c
new file mode 100644
index 000000000..ac5642037
--- /dev/null
+++ b/test-wildmatch.c
@@ -0,0 +1,14 @@
+#include "cache.h"
+#include "wildmatch.h"
+
+int main(int argc, char **argv)
+{
+ if (!strcmp(argv[1], "wildmatch"))
+ return wildmatch(argv[3], argv[2]) ? 0 : 1;
+ else if (!strcmp(argv[1], "iwildmatch"))
+ return iwildmatch(argv[3], argv[2]) ? 0 : 1;
+ else if (!strcmp(argv[1], "fnmatch"))
+ return !!fnmatch(argv[3], argv[2], FNM_PATHNAME);
+ else
+ return 1;
+}