diff --git a/binding.gyp b/binding.gyp index ded6dc7f..71fafacd 100644 --- a/binding.gyp +++ b/binding.gyp @@ -129,8 +129,8 @@ 'deps/libgit2/src/fileops.h', 'deps/libgit2/src/filter.c', 'deps/libgit2/src/filter.h', - 'deps/libgit2/src/fnmatch.c', - 'deps/libgit2/src/fnmatch.h', + 'deps/libgit2/src/wildmatch.c', + 'deps/libgit2/src/wildmatch.h', 'deps/libgit2/src/global.c', 'deps/libgit2/src/global.h', 'deps/libgit2/src/graph.c', @@ -239,8 +239,8 @@ 'deps/libgit2/src/stash.c', 'deps/libgit2/src/status.c', 'deps/libgit2/src/status.h', - 'deps/libgit2/src/stdalloc.c', - 'deps/libgit2/src/stdalloc.h', + 'deps/libgit2/src/allocators/stdalloc.c', + 'deps/libgit2/src/allocators/stdalloc.h', 'deps/libgit2/src/stream.h', 'deps/libgit2/src/strmap.c', 'deps/libgit2/src/strmap.h', @@ -340,9 +340,10 @@ ['OS=="win"', { 'defines': [ 'GIT_WINHTTP', + 'GIT_REGEX_BUILTIN', ], - 'include_dirs': [ - 'deps/libgit2/deps/regex', + 'dependencies': [ + 'pcre', ], 'link_settings': { 'libraries': [ @@ -380,6 +381,7 @@ 4013, # 'InterlockedDecrement' undefined; assuming extern returning int ], 'sources': [ + 'deps/libgit2/src/net.c', 'deps/libgit2/src/win32/dir.c', 'deps/libgit2/src/win32/dir.h', 'deps/libgit2/src/win32/error.c', @@ -410,8 +412,6 @@ 'deps/libgit2/src/win32/w32_util.c', 'deps/libgit2/src/win32/w32_util.h', 'deps/libgit2/src/win32/win32-compat.h', - 'deps/libgit2/deps/regex/regex.c', - 'deps/libgit2/deps/regex/regex.h', ], }, { 'libraries': [ @@ -519,4 +519,58 @@ ], }, ], + 'conditions': [ + ['OS=="win"', { + 'targets': [ + { + 'target_name': 'pcre', + 'win_delay_load_hook': 'false', + 'type': 'static_library', + 'sources': [ + 'deps/libgit2/deps/pcre/pcre_byte_order.c', + 'deps/libgit2/deps/pcre/pcre_chartables.c', + 'deps/libgit2/deps/pcre/pcre_compile.c', + 'deps/libgit2/deps/pcre/pcre_config.c', + 'deps/libgit2/deps/pcre/pcre_dfa_exec.c', + 'deps/libgit2/deps/pcre/pcre_exec.c', + 'deps/libgit2/deps/pcre/pcre_fullinfo.c', + 'deps/libgit2/deps/pcre/pcre_get.c', + 'deps/libgit2/deps/pcre/pcre_globals.c', + 'deps/libgit2/deps/pcre/pcre_jit_compile.c', + 'deps/libgit2/deps/pcre/pcre_maketables.c', + 'deps/libgit2/deps/pcre/pcre_newline.c', + 'deps/libgit2/deps/pcre/pcre_ord2utf8.c', + 'deps/libgit2/deps/pcre/pcre_refcount.c', + 'deps/libgit2/deps/pcre/pcre_string_utils.c', + 'deps/libgit2/deps/pcre/pcre_study.c', + 'deps/libgit2/deps/pcre/pcre_tables.c', + 'deps/libgit2/deps/pcre/pcre_ucd.c', + 'deps/libgit2/deps/pcre/pcre_valid_utf8.c', + 'deps/libgit2/deps/pcre/pcre_version.c', + 'deps/libgit2/deps/pcre/pcre_xclass.c', + 'deps/libgit2/deps/pcre/pcreposix.c', + ], + 'defines': [ + 'SUPPORT_PCRE8=1', + 'LINK_SIZE=2', + 'PARENS_NEST_LIMIT=250', + 'MATCH_LIMIT=10000000', + 'MATCH_LIMIT_RECURSION="MATCH_LIMIT"', + 'NEWLINE="LF"', + 'NO_RECURSE=1', + 'POSIX_MALLOC_THRESHOLD=10', + 'BSR_ANYCRLF=0', + 'MAX_NAME_SIZE=32', + 'MAX_NAME_COUNT=10000', + ], + 'include_dirs': [], + 'direct_dependent_settings': { + 'include_dirs': [ + 'deps/libgit2/deps/pcre', + ], + }, + }, + ] + }] + ] } diff --git a/deps/libgit2 b/deps/libgit2 index 9084712b..fef847ae 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit 9084712b555a876873bd7d7583f5befd47647c9d +Subproject commit fef847ae57d74e93563bc04222d9da7007fffc4f diff --git a/package-lock.json b/package-lock.json index c55a35ba..99dab848 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1595,14 +1595,37 @@ "integrity": "sha1-uDx1fIAOaOHW78GjoaE/85/23NI=", "dev": true, "requires": { - "jasmine-node": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", + "jasmine-node": "jasmine-node@git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", "underscore-plus": "1.x", "walkdir": "0.0.7" + }, + "dependencies": { + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + }, + "underscore-plus": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.6.6.tgz", + "integrity": "sha1-ZezeG9xEGjXYnmUP1w3PE65Dmn0=", + "dev": true, + "requires": { + "underscore": "~1.6.0" + } + }, + "walkdir": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.7.tgz", + "integrity": "sha1-BNoCcKh6d4VAFzzb8KLbSZqNnik=", + "dev": true + } } }, "jasmine-node": { "version": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", - "from": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", + "from": "jasmine-node@git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", "dev": true, "requires": { "coffee-script": ">=1.0.1", @@ -2416,23 +2439,6 @@ "integrity": "sha1-EzXF5PXm0zu7SwBrqMhqAPVW3gg=", "dev": true }, - "underscore-plus": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.7.0.tgz", - "integrity": "sha512-A3BEzkeicFLnr+U/Q3EyWwJAQPbA19mtZZ4h+lLq3ttm9kn8WC4R3YpuJZEXmWdLjYP47Zc8aLZm9kwdv+zzvA==", - "dev": true, - "requires": { - "underscore": "^1.9.1" - }, - "dependencies": { - "underscore": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", - "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", - "dev": true - } - } - }, "uniq": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", diff --git a/spec/fixtures/ignored.git/info/exclude b/spec/fixtures/ignored.git/info/exclude index eaa5fa87..4c2695aa 100644 --- a/spec/fixtures/ignored.git/info/exclude +++ b/spec/fixtures/ignored.git/info/exclude @@ -1 +1,2 @@ a.txt +**.foo diff --git a/spec/git-spec.js b/spec/git-spec.js index 2ebff2dd..342cda70 100644 --- a/spec/git-spec.js +++ b/spec/git-spec.js @@ -132,6 +132,8 @@ describe('git', () => { repo = git.open(ignoreRepoDir) expect(repo.isIgnored('a.txt')).toBe(true) expect(repo.isIgnored('subdir/subdir')).toBe(true) + expect(repo.isIgnored('a.foo')).toBe(true) + expect(repo.isIgnored('subdir/a.foo')).toBe(true) }) })