From d34ddc4cd663fe4ddf075dc37c11216cb331d43d Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Mon, 14 Apr 2014 12:44:05 -0400 Subject: [PATCH 001/194] Implement a basic "add to index" method. --- spec/git-spec.coffee | 14 ++++++++++++++ src/repository.cc | 17 +++++++++++++++++ src/repository.h | 1 + 3 files changed, 32 insertions(+) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 4f7551bd..2059763e 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -551,3 +551,17 @@ describe "git", -> expect(repo.submoduleForPath('sub/').getPath()).toBe submoduleRepoPath expect(repo.submoduleForPath('sub/a').getPath()).toBe submoduleRepoPath expect(repo.submoduleForPath('sub/a/b/c/d').getPath()).toBe submoduleRepoPath + + describe ".add(path)", -> + beforeEach -> + repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + + filePath = path.join(repoDirectory, 'toadd.txt') + fs.writeFileSync(filePath, 'changes to stage', 'utf8') + + it "introduces the current state of the file to the index", -> + expect(repo.getStatus 'toadd.txt').toBe 1 << 7 + repo.add('toadd.txt') + expect(repo.getStatus 'toadd.txt').toBe 1 << 0 diff --git a/src/repository.cc b/src/repository.cc index aa49907c..37e25593 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -60,6 +60,7 @@ void Repository::Init(Handle target) { NODE_SET_METHOD(proto, "getLineDiffs", Repository::GetLineDiffs); NODE_SET_METHOD(proto, "getReferences", Repository::GetReferences); NODE_SET_METHOD(proto, "checkoutRef", Repository::CheckoutReference); + NODE_SET_METHOD(proto, "add", Repository::Add); target->Set(NanSymbol("Repository"), newTemplate->GetFunction()); } @@ -754,6 +755,22 @@ NAN_METHOD(Repository::CheckoutReference) { NanReturnValue(Boolean::New(false)); } +NAN_METHOD(Repository::Add) { + NanScope(); + + git_repository* repository = GetRepository(args); + std::string path(*String::Utf8Value(args[0])); + + git_index *index; + if (git_repository_index(&index, repository) != GIT_OK) + NanReturnValue(Boolean::New(false)); + + if (git_index_add_bypath(index, path.c_str()) != GIT_OK) + NanReturnValue(Boolean::New(false)); + + NanReturnValue(Boolean::New(true)); +} + Repository::Repository(Handle path) { NanScope(); diff --git a/src/repository.h b/src/repository.h index eae1ce6e..cff7ce06 100644 --- a/src/repository.h +++ b/src/repository.h @@ -57,6 +57,7 @@ class Repository : public node::ObjectWrap { static NAN_METHOD(GetLineDiffs); static NAN_METHOD(GetReferences); static NAN_METHOD(CheckoutReference); + static NAN_METHOD(Add); static int StatusCallback(const char *path, unsigned int status, void *payload); From 74c4a3db44031eb1c03ebb73e635c81a164ee68c Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Mon, 14 Apr 2014 13:50:16 -0400 Subject: [PATCH 002/194] Throw errors instead of returning a boolean. --- spec/git-spec.coffee | 3 +++ src/repository.cc | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 2059763e..086b05d8 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -565,3 +565,6 @@ describe "git", -> expect(repo.getStatus 'toadd.txt').toBe 1 << 7 repo.add('toadd.txt') expect(repo.getStatus 'toadd.txt').toBe 1 << 0 + + it "throws an error if the file doesn't exist", -> + expect(-> repo.add('missing.txt')).toThrow() diff --git a/src/repository.cc b/src/repository.cc index 37e25593..7a090423 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -762,11 +762,15 @@ NAN_METHOD(Repository::Add) { std::string path(*String::Utf8Value(args[0])); git_index *index; - if (git_repository_index(&index, repository) != GIT_OK) - NanReturnValue(Boolean::New(false)); + if (git_repository_index(&index, repository) != GIT_OK) { + const git_error *e = giterr_last(); + return NanThrowError(e->message); + } - if (git_index_add_bypath(index, path.c_str()) != GIT_OK) - NanReturnValue(Boolean::New(false)); + if (git_index_add_bypath(index, path.c_str()) != GIT_OK) { + const git_error *e = giterr_last(); + return NanThrowError(e->message); + } NanReturnValue(Boolean::New(true)); } From 6ca66affa2f267d38e3c5376f27a684f2edc9583 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Mon, 14 Apr 2014 17:14:22 -0400 Subject: [PATCH 003/194] Add documentation to the README. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index a6958fd5..c5280b71 100644 --- a/README.md +++ b/README.md @@ -299,3 +299,12 @@ Get the repository for the submodule that the path is located in. `path` - The absolute or repository-relative string path. Returns a `Repository` or `null` if the path isn't in a submodule. + +### Repository.add(path) + +Stage the changes in `path` into the repository's index. Clear any conflict state associated with +`path`. + +`path` - A repository-relative string path. + +Raises an `Error` if the path isn't readable or if another exception occurs. From 71bf7bfaa1481e3c8b060a238f903f5252a53606 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Mon, 14 Apr 2014 17:15:47 -0400 Subject: [PATCH 004/194] Right, wrap lines at 80 characters to be consistent. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c5280b71..f3dd43a1 100644 --- a/README.md +++ b/README.md @@ -302,8 +302,8 @@ Returns a `Repository` or `null` if the path isn't in a submodule. ### Repository.add(path) -Stage the changes in `path` into the repository's index. Clear any conflict state associated with -`path`. +Stage the changes in `path` into the repository's index. Clear any conflict state +associated with `path`. `path` - A repository-relative string path. From 74ab995a1b2b1a001b66da9952e364241b4b5df1 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Wed, 16 Apr 2014 12:52:38 -0400 Subject: [PATCH 005/194] Free the git_index in all code paths. --- src/repository.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/repository.cc b/src/repository.cc index 7a090423..a5fecd33 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -768,10 +768,12 @@ NAN_METHOD(Repository::Add) { } if (git_index_add_bypath(index, path.c_str()) != GIT_OK) { + git_index_free(index); const git_error *e = giterr_last(); return NanThrowError(e->message); } + git_index_free(index); NanReturnValue(Boolean::New(true)); } From 997075165df5efaaa7e4bf3e4ec5039db8a064a9 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Wed, 16 Apr 2014 13:00:27 -0400 Subject: [PATCH 006/194] Be cautious about NULL pointers from geterr_last(). --- src/repository.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index a5fecd33..b1a24f43 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -764,13 +764,21 @@ NAN_METHOD(Repository::Add) { git_index *index; if (git_repository_index(&index, repository) != GIT_OK) { const git_error *e = giterr_last(); - return NanThrowError(e->message); + if (e != NULL) { + return NanThrowError(e->message); + } else { + return NanThrowError("Unknown error opening index"); + } } if (git_index_add_bypath(index, path.c_str()) != GIT_OK) { git_index_free(index); const git_error *e = giterr_last(); - return NanThrowError(e->message); + if (e != NULL) { + return NanThrowError(e->message); + } else { + return NanThrowError("Unknown error adding path to index"); + } } git_index_free(index); From 09816efb4b85927b2d55194a5a7e54f3755c8178 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Thu, 17 Apr 2014 16:50:40 -0400 Subject: [PATCH 007/194] Drop the `{}` around single-line if statements. --- src/repository.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index b1a24f43..4c0cb4b0 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -764,21 +764,19 @@ NAN_METHOD(Repository::Add) { git_index *index; if (git_repository_index(&index, repository) != GIT_OK) { const git_error *e = giterr_last(); - if (e != NULL) { + if (e != NULL) return NanThrowError(e->message); - } else { + else return NanThrowError("Unknown error opening index"); - } } if (git_index_add_bypath(index, path.c_str()) != GIT_OK) { git_index_free(index); const git_error *e = giterr_last(); - if (e != NULL) { + if (e != NULL) return NanThrowError(e->message); - } else { + else return NanThrowError("Unknown error adding path to index"); - } } git_index_free(index); From 9a3c6b9f731bf492ffd8c7838a0f78f8a50eef7b Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Thu, 17 Apr 2014 16:51:27 -0400 Subject: [PATCH 008/194] Put the * next to the type. Consistency :point_up: --- src/repository.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index 4c0cb4b0..516ebd87 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -761,9 +761,9 @@ NAN_METHOD(Repository::Add) { git_repository* repository = GetRepository(args); std::string path(*String::Utf8Value(args[0])); - git_index *index; + git_index* index; if (git_repository_index(&index, repository) != GIT_OK) { - const git_error *e = giterr_last(); + const git_error* e = giterr_last(); if (e != NULL) return NanThrowError(e->message); else @@ -772,7 +772,7 @@ NAN_METHOD(Repository::Add) { if (git_index_add_bypath(index, path.c_str()) != GIT_OK) { git_index_free(index); - const git_error *e = giterr_last(); + const git_error* e = giterr_last(); if (e != NULL) return NanThrowError(e->message); else From 000a789676792d3b396be563ce5256e00bd3e5e7 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 17 Apr 2014 13:59:43 -0700 Subject: [PATCH 009/194] Start building on 0.11.10 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 195a90f8..7282b1c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,5 @@ notifications: email: false node_js: - - 0.10 + - "0.10" + - "0.11.10" From 9d015b3a196c6083107fff2ee84a949e58d70b2d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 1 May 2014 14:07:28 -0700 Subject: [PATCH 010/194] Add Repository::isStatusIgnored(status) --- README.md | 8 ++++++++ spec/git-spec.coffee | 15 ++++++++++++++- src/git.coffee | 5 ++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f3dd43a1..661dc445 100644 --- a/README.md +++ b/README.md @@ -241,6 +241,14 @@ Get the deleted status of a given path. Returns `true` if the path is deleted, `false` otherwise. +### Repository.isStatusIgnored(status) + +Check if a status value represents an ignored path. + +`status` - The integer status value. + +Returns `true` if the status is a ignored one, `false` otherwise. + ### Repository.isStatusModified(status) Check if a status value represents a modified path. diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 086b05d8..2559d84e 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -1,6 +1,6 @@ git = require '../lib/git' path = require 'path' -fs = require 'fs' +fs = require 'fs-plus' {exec} = require 'child_process' wrench = require 'wrench' temp = require 'temp' @@ -170,6 +170,19 @@ describe "git", -> fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new.txt'), 'new', 'utf8') expect(repo.isPathNew('new.txt')).toBe true + describe '.isStatusIgnored(status)', -> + it 'returns true when the status is ignored, false otherwise', -> + repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/ignored.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + ignoreFile = path.join(repo.getWorkingDirectory(), '.git/info/exclude') + fs.writeFileSync(ignoreFile, 'c.txt') + fs.writeFileSync(path.join(repoDirectory, 'c.txt'), '') + + expect(repo.isStatusIgnored(repo.getStatus('c.txt'))).toBe true + expect(repo.isStatusIgnored(repo.getStatus('b.txt'))).toBe false + expect(repo.isStatusIgnored()).toBe false + describe '.getUpstreamBranch()', -> describe 'when no upstream branch exists', -> it 'returns null', -> diff --git a/src/git.coffee b/src/git.coffee index 21acbdb6..7f1cc938 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -11,7 +11,7 @@ statusWorkingDirNew = 1 << 7 statusWorkingDirModified = 1 << 8 statusWorkingDirDelete = 1 << 9 statusWorkingDirTypeChange = 1 << 10 -statusIgnore = 1 << 14 +statusIgnored = 1 << 14 modifiedStatusFlags = statusWorkingDirModified | statusIndexModified | statusWorkingDirDelete | statusIndexDeleted | @@ -55,6 +55,9 @@ Repository::isStatusDeleted = (status=0) -> Repository::isPathDeleted = (path) -> @isStatusDeleted(@getStatus(path)) +Repository::isStatusIgnored = (status=0) -> + (status & statusIgnored) > 0 + Repository::getUpstreamBranch = (branch) -> branch ?= @getHead() return null unless branch?.length > 11 From 08a3b272235e586d76d2d32031d80db497b117f6 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 1 May 2014 14:08:28 -0700 Subject: [PATCH 011/194] Remove unneeded fs.mkdirSync call --- spec/git-spec.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 2559d84e..63685971 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -381,7 +381,6 @@ describe "git", -> newFilePath = path.join(repo.getWorkingDirectory(), 'b.txt') fs.writeFileSync(newFilePath, '', 'utf8') - fs.mkdirSync(path.join(repo.getWorkingDirectory(), '.git/info')) ignoreFile = path.join(repo.getWorkingDirectory(), '.git/info/exclude') fs.writeFileSync(ignoreFile, 'c.txt', 'utf8') ignoredFilePath = path.join(repo.getWorkingDirectory(), 'c.txt') From 99cc74545874f1d3a955242a3d0ac99b8fb044cb Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 1 May 2014 14:08:40 -0700 Subject: [PATCH 012/194] 1.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 69a8a8ea..e2ed05e6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "1.2.2", + "version": "1.3.0", "licenses": [ { "type": "MIT", From 33ff0a68f1d5ef1708bf22686dd1558c1e35b1fb Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 27 May 2014 10:20:29 -0700 Subject: [PATCH 013/194] Add Repository::isWorkingDirectory(path) --- spec/git-spec.coffee | 19 +++++++++++++++++++ src/git.coffee | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 63685971..db460a90 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -534,6 +534,25 @@ describe "git", -> expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2'))).toBe 'test2' expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2/test3'))).toBe 'test2/test3' + describe ".isWorkingDirectory(path)", -> + it "returns whether the given path is the repository's working directory", -> + repo = git.open(__dirname) + workingDirectory = repo.getWorkingDirectory() + + expect(repo.isWorkingDirectory(workingDirectory)).toBe true + expect(repo.isWorkingDirectory()).toBe false + expect(repo.isWorkingDirectory(null)).toBe false + expect(repo.isWorkingDirectory('')).toBe false + expect(repo.isWorkingDirectory('test')).toBe false + + repoDirectory = temp.mkdirSync('lower-case-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + repo.caseInsensitiveFs = true + workingDirectory = repo.getWorkingDirectory() + + expect(repo.isWorkingDirectory(workingDirectory.toUpperCase())).toBe true + describe ".submoduleForPath(path)", -> beforeEach -> repoDirectory = temp.mkdirSync('node-git-repo-') diff --git a/src/git.coffee b/src/git.coffee index 7f1cc938..9f260535 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -147,6 +147,24 @@ Repository::submoduleForPath = (path) -> null +Repository::isWorkingDirectory = (path) -> + return false unless path + + if process.platform is 'win32' + path = path.replace(/\\/g, '/') + else + return false unless path[0] is '/' + + if @caseInsensitiveFs + lowerCasePath = path.toLowerCase() + return true if lowerCasePath is @getWorkingDirectory()?.toLowerCase() + return true if lowerCasePath is @openedWorkingDirectory?.toLowerCase() + else + return true if path is @getWorkingDirectory() + return true if path is @openedWorkingDirectory + + false + realpath = (unrealPath) -> try fs.realpathSync(unrealPath) From 7464eca355694161cfe6497a974441386699097c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 27 May 2014 10:23:27 -0700 Subject: [PATCH 014/194] :memo: Doc Repository.isWorkingDirectory(path) --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 661dc445..33ed39a1 100644 --- a/README.md +++ b/README.md @@ -295,6 +295,20 @@ Relativize the given path to the repository's working directory. Returns a repository-relative path if the given path is prefixed with the repository's working directory path. +### Repository.isWorkingDirectory(path) + +Is the given path the repository's working directory? + +It is better to call this method than comparing a path directly against +the value of `getWorkingDirectory()` since this method handles slash +normalization on Windows, case insensitive filesystems, and symlinked +repositories. + +`path` - The string path to check. + +Returns `true` if the given path is the repository's working directory, +false otherwise. + ### Repository.release() Release the repository and close all file handles it has open. No other methods From 722597070a5e90ed7776bc22f3806caa841879f0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 27 May 2014 10:23:56 -0700 Subject: [PATCH 015/194] 1.4.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e2ed05e6..d2a9d3a3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "1.3.0", + "version": "1.4.0", "licenses": [ { "type": "MIT", From a0da144fed5800aaf5b9038d5dba62095238a7d4 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 13 Jun 2014 15:34:05 -0700 Subject: [PATCH 016/194] Enable Travis email notifications --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7282b1c8..85eba05f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,9 @@ language: node_js notifications: - email: false + email: + on_success: never + on_failure: change node_js: - "0.10" From 8bd9365bb928e5f5fb464d8187c0beeb14a0e0b9 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 13 Jun 2014 15:39:14 -0700 Subject: [PATCH 017/194] Only build on node 0.10 for now --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 85eba05f..3299d793 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,4 +7,3 @@ notifications: node_js: - "0.10" - - "0.11.10" From 2d67004f8c01c048f317a0a68d6b8c8b5105e065 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 16 Jun 2014 12:46:19 -0700 Subject: [PATCH 018/194] Ignore macro redefinition warnings --- binding.gyp | 1 + 1 file changed, 1 insertion(+) diff --git a/binding.gyp b/binding.gyp index a4aa0e42..32447307 100644 --- a/binding.gyp +++ b/binding.gyp @@ -274,6 +274,7 @@ ], }, 'msvs_disabled_warnings': [ + 4005, # macro redefinition 4244, # conversion from 'ssize_t' to 'int32_t', possible loss of data 4267, # conversion from 'size_t' to 'int', possible loss of data 4090, # different 'volatile' qualifiers From 1849c4f7ca15a6e33bbadd58c6c846cda448f28a Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 16 Jun 2014 12:48:33 -0700 Subject: [PATCH 019/194] Ignore 4005 warning on zlib build --- binding.gyp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/binding.gyp b/binding.gyp index 32447307..cbf326ed 100644 --- a/binding.gyp +++ b/binding.gyp @@ -372,6 +372,13 @@ 'deps/libgit2/deps/zlib', ], }, + 'conditions': [ + ['OS=="win"', { + 'msvs_disabled_warnings': [ + 4005, # macro redefinition + ], + }], + ], }, { 'target_name': 'http_parser', From a3842033b4e715f1c806b791957388c11754e244 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 16 Jun 2014 12:50:17 -0700 Subject: [PATCH 020/194] Ignore 4244 warning from nan --- binding.gyp | 1 + 1 file changed, 1 insertion(+) diff --git a/binding.gyp b/binding.gyp index cbf326ed..ec601781 100644 --- a/binding.gyp +++ b/binding.gyp @@ -12,6 +12,7 @@ 'conditions': [ ['OS=="win"', { 'msvs_disabled_warnings': [ + 4244, # conversion from 'ssize_t' to 'int32_t', possible loss of data 4530, # C++ exception handler used, but unwind semantics are not enabled. 4506, # no definition for inline function 4267, # conversion from 'size_t' to 'int', possible loss of data From 71df1b7d8ffed821a5cba0c39302199990473c74 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 18 Jun 2014 11:37:58 -0700 Subject: [PATCH 021/194] 1.4.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d2a9d3a3..8d2ea7ce 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "1.4.0", + "version": "1.4.1", "licenses": [ { "type": "MIT", From 8e62806211e01fb1811b97c49678e6bd8e1789b0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 20 Jun 2014 15:03:29 -0700 Subject: [PATCH 022/194] Use proper windows method chaining --- spec/git-spec.coffee | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index db460a90..fa58c1c5 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -6,6 +6,13 @@ wrench = require 'wrench' temp = require 'temp' _ = require 'underscore' +execCommands = (commands, callback) -> + if process.platform is 'win32' + command = commands.join(' & ') + else + command = commands.join(' && ') + exec(command, callback) + describe "git", -> repo = null @@ -352,7 +359,7 @@ describe "git", -> expect(repo.getIndexBlob('a.txt')).toBe 'first line\n' gitCommandHandler = jasmine.createSpy('gitCommandHandler') - exec "cd #{repoDirectory} && git add a.txt", gitCommandHandler + execCommands ["cd #{repoDirectory}", "git add a.txt"], gitCommandHandler waitsFor -> gitCommandHandler.callCount is 1 @@ -473,7 +480,7 @@ describe "git", -> fs.writeFileSync(filePath, 'first line is different', 'utf8') gitCommandHandler = jasmine.createSpy('gitCommandHandler') - exec "cd #{repoDirectory} && git add a.txt", gitCommandHandler + execCommands ["cd #{repoDirectory}", "git add a.txt"], gitCommandHandler waitsFor -> gitCommandHandler.callCount is 1 @@ -561,7 +568,7 @@ describe "git", -> wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures', 'master.git'), path.join(submoduleDirectory, '.git')) gitCommandHandler = jasmine.createSpy('gitCommandHandler') - exec "cd #{repoDirectory} && git submodule add #{submoduleDirectory} sub", gitCommandHandler + execCommands ["cd #{repoDirectory}", "git submodule add #{submoduleDirectory} sub"], gitCommandHandler waitsFor -> gitCommandHandler.callCount is 1 From e83d7ae69a08f0808241aa28c122a220f04842dd Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 20 Jun 2014 15:12:52 -0700 Subject: [PATCH 023/194] Use execCommands helper in checkout spec --- spec/git-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index fa58c1c5..ca0193f1 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -223,7 +223,7 @@ describe "git", -> it 'does not check a branch out if the dirty tree interferes', -> fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'README.md'), 'great words', 'utf8') gitCommandHandler = jasmine.createSpy('gitCommandHandler') - exec "cd #{repoDirectory} && git add . && git commit -m 'update README'", gitCommandHandler + execCommands ["cd #{repoDirectory}", "git add .", "git commit -m 'update README'"], gitCommandHandler waitsFor -> gitCommandHandler.callCount is 1 From 7af698546835948e2326bd3a6acf3c806f73254f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 20 Jun 2014 15:15:29 -0700 Subject: [PATCH 024/194] Use single word commit message --- spec/git-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index ca0193f1..3b6a9d27 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -223,7 +223,7 @@ describe "git", -> it 'does not check a branch out if the dirty tree interferes', -> fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'README.md'), 'great words', 'utf8') gitCommandHandler = jasmine.createSpy('gitCommandHandler') - execCommands ["cd #{repoDirectory}", "git add .", "git commit -m 'update README'"], gitCommandHandler + execCommands ["cd #{repoDirectory}", "git add .", "git commit -m 'comitting'"], gitCommandHandler waitsFor -> gitCommandHandler.callCount is 1 From e3766e1a7213fd36bda9bc73e7638b0f671a0cae Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 24 Jun 2014 09:11:44 -0700 Subject: [PATCH 025/194] Upgrade to libgit@0.21.0 --- deps/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libgit2 b/deps/libgit2 index 43cb8b32..28f087c8 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit 43cb8b32428b1b29994874349ec22eb5372e152c +Subproject commit 28f087c8642ff9c8dd6964e101e6d8539db6281a From 12a1affe285878348f3f9b7f700a845b49b5d80f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 24 Jun 2014 09:14:41 -0700 Subject: [PATCH 026/194] Remove deleted file --- binding.gyp | 2 -- 1 file changed, 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index ec601781..2d66be23 100644 --- a/binding.gyp +++ b/binding.gyp @@ -70,8 +70,6 @@ 'deps/libgit2/src/commit_list.c', 'deps/libgit2/src/commit_list.h', 'deps/libgit2/src/common.h', - 'deps/libgit2/src/compress.c', - 'deps/libgit2/src/compress.h', 'deps/libgit2/src/config.c', 'deps/libgit2/src/config.h', 'deps/libgit2/src/config_cache.c', From 72dc82d90cbcb7bc8b4eecc68faa7b531aed26ec Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 24 Jun 2014 09:17:17 -0700 Subject: [PATCH 027/194] Add NULL params to git_repository_set_head --- src/repository.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/repository.cc b/src/repository.cc index 516ebd87..f61eee07 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -692,7 +692,7 @@ int branch_checkout(git_repository* repo, const char* refName) { if (!(success = git_reference_lookup(&ref, repo, refName)) && !(success = git_reference_peel(&git_obj, ref, GIT_OBJ_TREE)) && !(success = git_checkout_tree(repo, git_obj, &opts))) - success = git_repository_set_head(repo, refName); + success = git_repository_set_head(repo, refName, NULL, NULL); git_object_free(git_obj); git_obj = NULL; From adc69b5e02f5fc41f1ac6dc6f4e06c681a7ec3a2 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 24 Jun 2014 09:18:17 -0700 Subject: [PATCH 028/194] options instead of opts --- src/repository.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index f61eee07..3d74e5db 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -265,7 +265,7 @@ NAN_METHOD(Repository::CheckoutHead) { String::Utf8Value utf8Path(args[0]); char* path = *utf8Path; - git_checkout_opts options = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options options = GIT_CHECKOUT_OPTIONS_INIT; options.checkout_strategy = GIT_CHECKOUT_FORCE | GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH; git_strarray paths; @@ -685,7 +685,7 @@ NAN_METHOD(Repository::GetReferences) { int branch_checkout(git_repository* repo, const char* refName) { git_reference* ref = NULL; git_object* git_obj = NULL; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE; int success = -1; From b568cb6e5cfe4b20c00265ba407e3aee75114a2b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 24 Jun 2014 09:21:08 -0700 Subject: [PATCH 029/194] id instead of oid --- src/repository.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index 3d74e5db..64073fe3 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -443,7 +443,7 @@ NAN_METHOD(Repository::GetIndexBlob) { } git_blob* blob = NULL; - const git_oid* blobSha = &entry->oid; + const git_oid* blobSha = &entry->id; if (blobSha != NULL && git_blob_lookup(&blob, repo, blobSha) != GIT_OK) blob = NULL; git_index_free(index); @@ -578,7 +578,7 @@ NAN_METHOD(Repository::GetLineDiffs) { NanReturnNull(); } - const git_oid* blobSha = &entry->oid; + const git_oid* blobSha = &entry->id; if (blobSha != NULL && git_blob_lookup(&blob, repo, blobSha) != GIT_OK) blob = NULL; } else { From dc049021b8c9748c550b5e8ddf40e6cc4d8a5e8b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 24 Jun 2014 09:22:12 -0700 Subject: [PATCH 030/194] Add missing NULL params --- src/repository.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/repository.cc b/src/repository.cc index 64073fe3..284743ed 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -740,7 +740,7 @@ NAN_METHOD(Repository::CheckoutReference) { std::string shortRefName(strRefName.c_str() + 11, kShortNameLength); int branchCreateStatus = git_branch_create( - &branch, repo, shortRefName.c_str(), commit, 0); + &branch, repo, shortRefName.c_str(), commit, 0, NULL, NULL); git_commit_free(commit); if (branchCreateStatus != GIT_OK) From e9d4efcfd01d043154d7d26e3ee8280acd93d35c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 24 Jun 2014 09:32:28 -0700 Subject: [PATCH 031/194] Add missing files to binding.gyp --- binding.gyp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/binding.gyp b/binding.gyp index 2d66be23..1b9259fd 100644 --- a/binding.gyp +++ b/binding.gyp @@ -49,7 +49,13 @@ 'deps/libgit2/src/attr_file.c', 'deps/libgit2/src/attr_file.h', 'deps/libgit2/src/bitvec.h', + 'deps/libgit2/src/attrcache.c', 'deps/libgit2/src/attrcache.h', + 'deps/libgit2/src/bitvec.h', + 'deps/libgit2/src/blame_git.c', + 'deps/libgit2/src/blame_git.h', + 'deps/libgit2/src/blame.c', + 'deps/libgit2/src/blame.h', 'deps/libgit2/src/blob.c', 'deps/libgit2/src/blob.h', 'deps/libgit2/src/branch.c', @@ -64,7 +70,9 @@ 'deps/libgit2/src/cc-compat.h', 'deps/libgit2/src/checkout.c', 'deps/libgit2/src/checkout.h', + 'deps/libgit2/src/cherrypick.c', 'deps/libgit2/src/clone.c', + 'deps/libgit2/src/clone.h', 'deps/libgit2/src/commit.c', 'deps/libgit2/src/commit.h', 'deps/libgit2/src/commit_list.c', @@ -90,6 +98,7 @@ 'deps/libgit2/src/diff_patch.c', 'deps/libgit2/src/diff_patch.h', 'deps/libgit2/src/diff_print.c', + 'deps/libgit2/src/diff_stats.c', 'deps/libgit2/src/diff_tform.c', 'deps/libgit2/src/diff_xdiff.c', 'deps/libgit2/src/diff_xdiff.h', @@ -141,6 +150,7 @@ 'deps/libgit2/src/odb.c', 'deps/libgit2/src/odb.h', 'deps/libgit2/src/odb_loose.c', + 'deps/libgit2/src/odb_mempack.c', 'deps/libgit2/src/odb_pack.c', 'deps/libgit2/src/offmap.h', 'deps/libgit2/src/oid.c', @@ -178,9 +188,11 @@ 'deps/libgit2/src/repository.c', 'deps/libgit2/src/repository.h', 'deps/libgit2/src/reset.c', + 'deps/libgit2/src/revert.c', 'deps/libgit2/src/revparse.c', 'deps/libgit2/src/revwalk.c', 'deps/libgit2/src/revwalk.h', + 'deps/libgit2/src/settings.c', 'deps/libgit2/src/sha1_lookup.c', 'deps/libgit2/src/sha1_lookup.h', 'deps/libgit2/src/signature.c', @@ -192,8 +204,11 @@ 'deps/libgit2/src/status.h', 'deps/libgit2/src/strmap.c', 'deps/libgit2/src/strmap.h', + 'deps/libgit2/src/strnlen.h', 'deps/libgit2/src/submodule.c', 'deps/libgit2/src/submodule.h', + 'deps/libgit2/src/sysdir.c', + 'deps/libgit2/src/sysdir.h', 'deps/libgit2/src/tag.c', 'deps/libgit2/src/tag.h', 'deps/libgit2/src/thread-utils.c', @@ -210,6 +225,8 @@ 'deps/libgit2/src/util.h', 'deps/libgit2/src/vector.c', 'deps/libgit2/src/vector.h', + 'deps/libgit2/src/zstream.c', + 'deps/libgit2/src/zstream.h', 'deps/libgit2/src/transports/cred.c', 'deps/libgit2/src/transports/cred_helpers.c', 'deps/libgit2/src/transports/git.c', @@ -237,6 +254,8 @@ 'deps/libgit2/src/xdiff/xutils.c', 'deps/libgit2/src/xdiff/xutils.h', 'deps/libgit2/src/hash/hash_generic.c', + 'deps/libgit2/src/hash/hash_generic.h', + 'deps/libgit2/src/hash/hash_openssl.h', ], 'conditions': [ ['OS=="linux"', { From 232f487462a49fc0e150a8da4ead1582f213c205 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 24 Jun 2014 09:34:15 -0700 Subject: [PATCH 032/194] Ignore unused function warnings from libgit2 --- binding.gyp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index 1b9259fd..20300244 100644 --- a/binding.gyp +++ b/binding.gyp @@ -332,12 +332,14 @@ ], 'cflags': [ '-Wno-missing-field-initializers', - '-Wno-unused-variable' + '-Wno-unused-variable', + '-Wno-unused-function', ], 'xcode_settings': { 'WARNING_CFLAGS': [ '-Wno-missing-field-initializers', - '-Wno-unused-variable' + '-Wno-unused-variable', + '-Wno-unused-function', ], }, }], From 8a33c92a353ad98463c67d979aef1da5d1853571 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 24 Jun 2014 09:39:46 -0700 Subject: [PATCH 033/194] Add new Windows files --- binding.gyp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/binding.gyp b/binding.gyp index 20300244..dbcb722a 100644 --- a/binding.gyp +++ b/binding.gyp @@ -316,9 +316,12 @@ 'deps/libgit2/src/win32/precompiled.h', 'deps/libgit2/src/win32/pthread.c', 'deps/libgit2/src/win32/pthread.h', + 'deps/libgit2/src/win32/reparse.h', 'deps/libgit2/src/win32/utf-conv.c', 'deps/libgit2/src/win32/utf-conv.h', 'deps/libgit2/src/win32/version.h', + 'deps/libgit2/src/win32/w32_util.c', + 'deps/libgit2/src/win32/w32_util.h', 'deps/libgit2/deps/regex/regex.c', ], }, { From 57eeeda76e3cd296250a4b2733ae901e161e1ed4 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 30 Jun 2014 17:45:42 +0800 Subject: [PATCH 034/194] Upgrade to nan@1.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8d2ea7ce..776d6b03 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "grunt-coffeelint": "0.0.6" }, "dependencies": { - "nan": "0.8.0", + "nan": "1.2.0", "bindings": "~1.0.0", "fs-plus": "^2.1.0" }, From 6d660537b9098741a6b87adebe34381f7854955d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 30 Jun 2014 17:50:19 +0800 Subject: [PATCH 035/194] Fix building under node 0.11.13. --- src/repository.cc | 131 ++++++++++++++++++++++++---------------------- 1 file changed, 68 insertions(+), 63 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index 284743ed..b8aa9731 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -31,9 +31,9 @@ void Repository::Init(Handle target) { git_threads_init(); - Local newTemplate = FunctionTemplate::New( + Local newTemplate = NanNew( Repository::New); - newTemplate->SetClassName(NanSymbol("Repository")); + newTemplate->SetClassName(NanNew("Repository")); newTemplate->InstanceTemplate()->SetInternalFieldCount(1); Local proto = newTemplate->PrototypeTemplate(); @@ -62,7 +62,7 @@ void Repository::Init(Handle target) { NODE_SET_METHOD(proto, "checkoutRef", Repository::CheckoutReference); NODE_SET_METHOD(proto, "add", Repository::Add); - target->Set(NanSymbol("Repository"), newTemplate->GetFunction()); + target->Set(NanNew("Repository"), newTemplate->GetFunction()); } NODE_MODULE(git, Repository::Init) @@ -89,21 +89,21 @@ git_diff_options Repository::CreateDefaultGitDiffOptions() { NAN_METHOD(Repository::Exists) { NanScope(); - NanReturnValue(Boolean::New(GetRepository(args) != NULL)); + NanReturnValue(NanNew(GetRepository(args) != NULL)); } NAN_METHOD(Repository::GetPath) { NanScope(); git_repository* repository = GetRepository(args); const char* path = git_repository_path(repository); - NanReturnValue(NanSymbol(path)); + NanReturnValue(NanNew(path)); } NAN_METHOD(Repository::GetWorkingDirectory) { NanScope(); git_repository* repository = GetRepository(args); const char* path = git_repository_workdir(repository); - NanReturnValue(NanSymbol(path)); + NanReturnValue(NanNew(path)); } NAN_METHOD(Repository::GetSubmodulePaths) { @@ -111,9 +111,9 @@ NAN_METHOD(Repository::GetSubmodulePaths) { git_repository* repository = GetRepository(args); std::vector paths; git_submodule_foreach(repository, SubmoduleCallback, &paths); - Local v8Paths = Array::New(paths.size()); + Local v8Paths = NanNew(paths.size()); for (size_t i = 0; i < paths.size(); i++) - v8Paths->Set(i, NanSymbol(paths[i].data())); + v8Paths->Set(i, NanNew(paths[i].data())); NanReturnValue(v8Paths); } @@ -130,11 +130,11 @@ NAN_METHOD(Repository::GetHead) { char oid[GIT_OID_HEXSZ + 1]; git_oid_tostr(oid, GIT_OID_HEXSZ + 1, sha); git_reference_free(head); - NanReturnValue(NanSymbol(oid)); + NanReturnValue(NanNew(oid)); } } - Local referenceName = NanSymbol(git_reference_name(head)); + Local referenceName = NanNew(git_reference_name(head)); git_reference_free(head); NanReturnValue(referenceName); } @@ -153,7 +153,7 @@ NAN_METHOD(Repository::RefreshIndex) { NAN_METHOD(Repository::IsIgnored) { NanScope(); if (args.Length() < 1) - NanReturnValue(Boolean::New(false)); + NanReturnValue(NanNew(false)); git_repository* repository = GetRepository(args); std::string path(*String::Utf8Value(args[0])); @@ -161,27 +161,27 @@ NAN_METHOD(Repository::IsIgnored) { if (git_ignore_path_is_ignored(&ignored, repository, path.c_str()) == GIT_OK) - NanReturnValue(Boolean::New(ignored == 1)); + NanReturnValue(NanNew(ignored == 1)); else - NanReturnValue(Boolean::New(false)); + NanReturnValue(NanNew(false)); } NAN_METHOD(Repository::IsSubmodule) { NanScope(); if (args.Length() < 1) - NanReturnValue(Boolean::New(false)); + NanReturnValue(NanNew(false)); git_index* index; git_repository* repository = GetRepository(args); if (git_repository_index(&index, repository) == GIT_OK) { std::string path(*String::Utf8Value(args[0])); const git_index_entry* entry = git_index_get_bypath(index, path.c_str(), 0); - Handle isSubmodule = Boolean::New( + Handle isSubmodule = NanNew( entry != NULL && (entry->mode & S_IFMT) == GIT_FILEMODE_COMMIT); git_index_free(index); NanReturnValue(isSubmodule); } else { - NanReturnValue(Boolean::New(false)); + NanReturnValue(NanNew(false)); } } @@ -199,7 +199,7 @@ NAN_METHOD(Repository::GetConfigValue) { const char* configValue; if (git_config_get_string( &configValue, config, configKey.c_str()) == GIT_OK) { - Handle configValueHandle = NanSymbol(configValue); + Handle configValueHandle = NanNew(configValue); git_config_free(config); NanReturnValue(configValueHandle); } else { @@ -211,12 +211,12 @@ NAN_METHOD(Repository::GetConfigValue) { NAN_METHOD(Repository::SetConfigValue) { NanScope(); if (args.Length() != 2) - NanReturnValue(Boolean::New(false)); + NanReturnValue(NanNew(false)); git_config* config; git_repository* repository = GetRepository(args); if (git_repository_config(&config, repository) != GIT_OK) - NanReturnValue(Boolean::New(false)); + NanReturnValue(NanNew(false)); std::string configKey(*String::Utf8Value(args[0])); std::string configValue(*String::Utf8Value(args[1])); @@ -224,14 +224,14 @@ NAN_METHOD(Repository::SetConfigValue) { int errorCode = git_config_set_string( config, configKey.c_str(), configValue.c_str()); git_config_free(config); - NanReturnValue(Boolean::New(errorCode == GIT_OK)); + NanReturnValue(NanNew(errorCode == GIT_OK)); } NAN_METHOD(Repository::GetStatus) { NanScope(); if (args.Length() < 1) { - Local result = Object::New(); + Local result = NanNew(); std::map statuses; git_status_options options = GIT_STATUS_OPTIONS_INIT; options.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | @@ -242,8 +242,8 @@ NAN_METHOD(Repository::GetStatus) { &statuses) == GIT_OK) { std::map::iterator iter = statuses.begin(); for (; iter != statuses.end(); ++iter) - result->Set(NanSymbol(iter->first.c_str()), - Number::New(iter->second)); + result->Set(NanNew(iter->first.c_str()), + NanNew(iter->second)); } NanReturnValue(result); } else { @@ -251,16 +251,16 @@ NAN_METHOD(Repository::GetStatus) { std::string path(*String::Utf8Value(args[0])); unsigned int status = 0; if (git_status_file(&status, repository, path.c_str()) == GIT_OK) - NanReturnValue(Number::New(status)); + NanReturnValue(NanNew(status)); else - NanReturnValue(Number::New(0)); + NanReturnValue(NanNew(0)); } } NAN_METHOD(Repository::CheckoutHead) { NanScope(); if (args.Length() < 1) - NanReturnValue(Boolean::New(false)); + NanReturnValue(NanNew(false)); String::Utf8Value utf8Path(args[0]); char* path = *utf8Path; @@ -274,7 +274,7 @@ NAN_METHOD(Repository::CheckoutHead) { options.paths = paths; int result = git_checkout_head(GetRepository(args), &options); - NanReturnValue(Boolean::New(result == GIT_OK)); + NanReturnValue(NanNew(result == GIT_OK)); } NAN_METHOD(Repository::GetReferenceTarget) { @@ -288,7 +288,7 @@ NAN_METHOD(Repository::GetReferenceTarget) { &sha, GetRepository(args), refName.c_str()) == GIT_OK) { char oid[GIT_OID_HEXSZ + 1]; git_oid_tostr(oid, GIT_OID_HEXSZ + 1, &sha); - NanReturnValue(NanSymbol(oid)); + NanReturnValue(NanNew(oid)); } else { NanReturnNull(); } @@ -299,9 +299,9 @@ NAN_METHOD(Repository::GetDiffStats) { int added = 0; int deleted = 0; - Local result = Object::New(); - result->Set(NanSymbol("added"), Number::New(added)); - result->Set(NanSymbol("deleted"), Number::New(deleted)); + Local result = NanNew(); + result->Set(NanNew("added"), NanNew(added)); + result->Set(NanNew("deleted"), NanNew(deleted)); if (args.Length() < 1) NanReturnValue(result); @@ -372,8 +372,8 @@ NAN_METHOD(Repository::GetDiffStats) { } git_patch_free(patch); - result->Set(NanSymbol("added"), Number::New(added)); - result->Set(NanSymbol("deleted"), Number::New(deleted)); + result->Set(NanNew("added"), NanNew(added)); + result->Set(NanNew("deleted"), NanNew(deleted)); NanReturnValue(result); } @@ -418,7 +418,7 @@ NAN_METHOD(Repository::GetHeadBlob) { NanReturnNull(); const char* content = static_cast(git_blob_rawcontent(blob)); - Handle value = NanSymbol(content); + Handle value = NanNew(content); git_blob_free(blob); NanReturnValue(value); } @@ -451,7 +451,7 @@ NAN_METHOD(Repository::GetIndexBlob) { NanReturnNull(); const char* content = static_cast(git_blob_rawcontent(blob)); - Handle value = NanSymbol(content); + Handle value = NanNew(content); git_blob_free(blob); NanReturnValue(value); } @@ -487,21 +487,21 @@ NAN_METHOD(Repository::Release) { NAN_METHOD(Repository::GetCommitCount) { NanScope(); if (args.Length() < 2) - NanReturnValue(Number::New(0)); + NanReturnValue(NanNew(0)); std::string fromCommitId(*String::Utf8Value(args[0])); git_oid fromCommit; if (git_oid_fromstr(&fromCommit, fromCommitId.c_str()) != GIT_OK) - NanReturnValue(Number::New(0)); + NanReturnValue(NanNew(0)); std::string toCommitId(*String::Utf8Value(args[1])); git_oid toCommit; if (git_oid_fromstr(&toCommit, toCommitId.c_str()) != GIT_OK) - NanReturnValue(Number::New(0)); + NanReturnValue(NanNew(0)); git_revwalk* revWalk; if (git_revwalk_new(&revWalk, GetRepository(args)) != GIT_OK) - NanReturnValue(Number::New(0)); + NanReturnValue(NanNew(0)); git_revwalk_push(revWalk, &fromCommit); git_revwalk_hide(revWalk, &toCommit); @@ -510,7 +510,7 @@ NAN_METHOD(Repository::GetCommitCount) { while (git_revwalk_next(¤tCommit, revWalk) == GIT_OK) count++; git_revwalk_free(revWalk); - NanReturnValue(Number::New(count)); + NanReturnValue(NanNew(count)); } NAN_METHOD(Repository::GetMergeBase) { @@ -533,7 +533,7 @@ NAN_METHOD(Repository::GetMergeBase) { &mergeBase, GetRepository(args), &commitOne, &commitTwo) == GIT_OK) { char mergeBaseId[GIT_OID_HEXSZ + 1]; git_oid_tostr(mergeBaseId, GIT_OID_HEXSZ + 1, &mergeBase); - NanReturnValue(NanSymbol(mergeBaseId)); + NanReturnValue(NanNew(mergeBaseId)); } NanReturnNull(); @@ -561,7 +561,7 @@ NAN_METHOD(Repository::GetLineDiffs) { int useIndex = false; if (args.Length() >= 3) { Local optionsArg(Local::Cast(args[2])); - if (optionsArg->Get(NanSymbol("useIndex"))->BooleanValue()) + if (optionsArg->Get(NanNew("useIndex"))->BooleanValue()) useIndex = true; } @@ -621,7 +621,7 @@ NAN_METHOD(Repository::GetLineDiffs) { // Set GIT_DIFF_IGNORE_WHITESPACE_EOL when ignoreEolWhitespace: true if (args.Length() >= 3) { Local optionsArg(Local::Cast(args[2])); - if (optionsArg->Get(NanSymbol("ignoreEolWhitespace"))->BooleanValue()) + if (optionsArg->Get(NanNew("ignoreEolWhitespace"))->BooleanValue()) options.flags = GIT_DIFF_IGNORE_WHITESPACE_EOL; } @@ -629,13 +629,17 @@ NAN_METHOD(Repository::GetLineDiffs) { if (git_diff_blob_to_buffer(blob, NULL, text.data(), text.length(), NULL, &options, NULL, DiffHunkCallback, NULL, &ranges) == GIT_OK) { - Local v8Ranges = Array::New(ranges.size()); + Local v8Ranges = NanNew(ranges.size()); for (size_t i = 0; i < ranges.size(); i++) { - Local v8Range = Object::New(); - v8Range->Set(NanSymbol("oldStart"), Number::New(ranges[i].old_start)); - v8Range->Set(NanSymbol("oldLines"), Number::New(ranges[i].old_lines)); - v8Range->Set(NanSymbol("newStart"), Number::New(ranges[i].new_start)); - v8Range->Set(NanSymbol("newLines"), Number::New(ranges[i].new_lines)); + Local v8Range = NanNew(); + v8Range->Set(NanNew("oldStart"), + NanNew(ranges[i].old_start)); + v8Range->Set(NanNew("oldLines"), + NanNew(ranges[i].old_lines)); + v8Range->Set(NanNew("newStart"), + NanNew(ranges[i].new_start)); + v8Range->Set(NanNew("newLines"), + NanNew(ranges[i].new_lines)); v8Ranges->Set(i, v8Range); } git_blob_free(blob); @@ -649,9 +653,9 @@ NAN_METHOD(Repository::GetLineDiffs) { Handle Repository::ConvertStringVectorToV8Array( const std::vector& vector) { size_t i = 0, size = vector.size(); - Local array = Array::New(size); + Local array = NanNew(size); for (i = 0; i < size; i++) - array->Set(i, NanSymbol(vector[i].c_str())); + array->Set(i, NanNew(vector[i].c_str())); return array; } @@ -659,7 +663,7 @@ Handle Repository::ConvertStringVectorToV8Array( NAN_METHOD(Repository::GetReferences) { NanScope(); - Local references = Object::New(); + Local references = NanNew(); std::vector heads, remotes, tags; git_strarray strarray; @@ -675,9 +679,10 @@ NAN_METHOD(Repository::GetReferences) { git_strarray_free(&strarray); - references->Set(NanSymbol("heads"), ConvertStringVectorToV8Array(heads)); - references->Set(NanSymbol("remotes"), ConvertStringVectorToV8Array(remotes)); - references->Set(NanSymbol("tags"), ConvertStringVectorToV8Array(tags)); + references->Set(NanNew("heads"), ConvertStringVectorToV8Array(heads)); + references->Set(NanNew("remotes"), + ConvertStringVectorToV8Array(remotes)); + references->Set(NanNew("tags"), ConvertStringVectorToV8Array(tags)); NanReturnValue(references); } @@ -706,7 +711,7 @@ NAN_METHOD(Repository::CheckoutReference) { NanScope(); if (args.Length() < 1) - NanReturnValue(Boolean::New(false)); + NanReturnValue(NanNew(false)); bool shouldCreateNewRef; if (args.Length() > 1 && args[1]->BooleanValue()) @@ -720,11 +725,11 @@ NAN_METHOD(Repository::CheckoutReference) { git_repository* repo = GetRepository(args); if (branch_checkout(repo, refName) == GIT_OK) { - NanReturnValue(Boolean::New(true)); + NanReturnValue(NanNew(true)); } else if (shouldCreateNewRef) { git_reference* head; if (git_repository_head(&head, repo) != GIT_OK) - NanReturnValue(Boolean::New(false)); + NanReturnValue(NanNew(false)); const git_oid* sha = git_reference_target(head); git_commit* commit; @@ -732,7 +737,7 @@ NAN_METHOD(Repository::CheckoutReference) { git_reference_free(head); if (commitStatus != GIT_OK) - NanReturnValue(Boolean::New(false)); + NanReturnValue(NanNew(false)); git_reference* branch; // N.B.: git_branch_create needs a name like 'xxx', not 'refs/heads/xxx' @@ -744,15 +749,15 @@ NAN_METHOD(Repository::CheckoutReference) { git_commit_free(commit); if (branchCreateStatus != GIT_OK) - NanReturnValue(Boolean::New(false)); + NanReturnValue(NanNew(false)); git_reference_free(branch); if (branch_checkout(repo, refName) == GIT_OK) - NanReturnValue(Boolean::New(true)); + NanReturnValue(NanNew(true)); } - NanReturnValue(Boolean::New(false)); + NanReturnValue(NanNew(false)); } NAN_METHOD(Repository::Add) { @@ -780,7 +785,7 @@ NAN_METHOD(Repository::Add) { } git_index_free(index); - NanReturnValue(Boolean::New(true)); + NanReturnValue(NanNew(true)); } Repository::Repository(Handle path) { From c06dc98f1b8f57199082e815f47399b9ec2782de Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 30 Jun 2014 17:50:42 +0800 Subject: [PATCH 036/194] Prepare 1.5.0 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 776d6b03..cf7c465f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "1.4.1", + "version": "1.5.0", "licenses": [ { "type": "MIT", From e932a91416d8a1004f635d2c9979ee6d19852e95 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 30 Jun 2014 18:01:46 +0800 Subject: [PATCH 037/194] Prepare 1.5.1 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cf7c465f..e8e73d79 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "1.5.0", + "version": "1.5.1", "licenses": [ { "type": "MIT", From 2fa12e04c3e7923a1b32f869d937407fd779d4b4 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 30 Jun 2014 09:56:14 +0000 Subject: [PATCH 038/194] Prepare 1.5.2 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e8e73d79..2c0a941b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "1.5.1", + "version": "1.5.2", "licenses": [ { "type": "MIT", From 072105d08fc8e401bb104937b3b22a8ca47001ff Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 1 Jul 2014 02:13:40 +0000 Subject: [PATCH 039/194] Prepare 2.0.0 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c0a941b..802ee28f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "1.5.2", + "version": "2.0.0", "licenses": [ { "type": "MIT", From 584e7c2ffd822e728e64f6c9ec078bad2b77e84f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 21 Jul 2014 16:01:13 -0700 Subject: [PATCH 040/194] 1.6.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8d2ea7ce..ff4daa53 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "1.4.1", + "version": "1.6.0", "licenses": [ { "type": "MIT", From 415f7bf64e8c7f21de98771f49c7eb4c8618ed75 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Jul 2014 02:01:50 +0000 Subject: [PATCH 041/194] 2.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 802ee28f..6196165d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "2.0.0", + "version": "2.1.0", "licenses": [ { "type": "MIT", From 339ab2864d82a296bcef5642cbd163eff0db07ac Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 24 Jul 2014 10:53:17 -0700 Subject: [PATCH 042/194] 2.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6196165d..a82aeeba 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "2.1.0", + "version": "2.1.1", "licenses": [ { "type": "MIT", From 192026c09a46c62a89fd7db59acb822501bc24cc Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 29 Jul 2014 16:04:15 -0700 Subject: [PATCH 043/194] Upgrade to bindings@1.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a82aeeba..ef420769 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ }, "dependencies": { "nan": "1.2.0", - "bindings": "~1.0.0", + "bindings": "~1.2.1", "fs-plus": "^2.1.0" }, "scripts": { From 3d0820eeaac55a9af233b8da1c22657405a62763 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 29 Jul 2014 16:04:20 -0700 Subject: [PATCH 044/194] 2.1.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ef420769..49cd5765 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "2.1.1", + "version": "2.1.2", "licenses": [ { "type": "MIT", From 66366d62fdae0c98f69d3ec55f90cb1a7ff7c731 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 29 Jul 2014 16:31:16 -0700 Subject: [PATCH 045/194] Require .node file directly Previously bindings was used which checks multiple paths but older node versions aren't even supported by git-utils. --- package.json | 1 - src/git.coffee | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 49cd5765..7dd4b880 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ }, "dependencies": { "nan": "1.2.0", - "bindings": "~1.2.1", "fs-plus": "^2.1.0" }, "scripts": { diff --git a/src/git.coffee b/src/git.coffee index 9f260535..5a9439d3 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -1,6 +1,6 @@ path = require 'path' fs = require 'fs-plus' -{Repository} = require('bindings')('git.node') +{Repository} = require('../build/Release/git.node') statusIndexNew = 1 << 0 statusIndexModified = 1 << 1 From 4ee8aa16b190ba5c71280e6eca9328c34e9385c5 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 29 Jul 2014 16:31:51 -0700 Subject: [PATCH 046/194] 2.1.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7dd4b880..83a6e75e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "2.1.2", + "version": "2.1.3", "licenses": [ { "type": "MIT", From 73a0a018ed64bacaf781454dd84fad395b593d34 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 8 Aug 2014 01:32:59 +0000 Subject: [PATCH 047/194] Suppress VS's warning on NanNew with char*. --- src/repository.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index b8aa9731..e8719be6 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -130,7 +130,7 @@ NAN_METHOD(Repository::GetHead) { char oid[GIT_OID_HEXSZ + 1]; git_oid_tostr(oid, GIT_OID_HEXSZ + 1, sha); git_reference_free(head); - NanReturnValue(NanNew(oid)); + NanReturnValue(NanNew(oid, -1)); } } @@ -288,7 +288,7 @@ NAN_METHOD(Repository::GetReferenceTarget) { &sha, GetRepository(args), refName.c_str()) == GIT_OK) { char oid[GIT_OID_HEXSZ + 1]; git_oid_tostr(oid, GIT_OID_HEXSZ + 1, &sha); - NanReturnValue(NanNew(oid)); + NanReturnValue(NanNew(oid, -1)); } else { NanReturnNull(); } @@ -533,7 +533,7 @@ NAN_METHOD(Repository::GetMergeBase) { &mergeBase, GetRepository(args), &commitOne, &commitTwo) == GIT_OK) { char mergeBaseId[GIT_OID_HEXSZ + 1]; git_oid_tostr(mergeBaseId, GIT_OID_HEXSZ + 1, &mergeBase); - NanReturnValue(NanNew(mergeBaseId)); + NanReturnValue(NanNew(mergeBaseId, -1)); } NanReturnNull(); From 254016a3cb317bbd13575a6bda93e86098f35936 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 8 Aug 2014 01:34:14 +0000 Subject: [PATCH 048/194] Ignore C4344 warning. --- binding.gyp | 1 + 1 file changed, 1 insertion(+) diff --git a/binding.gyp b/binding.gyp index dbcb722a..7677a54c 100644 --- a/binding.gyp +++ b/binding.gyp @@ -16,6 +16,7 @@ 4530, # C++ exception handler used, but unwind semantics are not enabled. 4506, # no definition for inline function 4267, # conversion from 'size_t' to 'int', possible loss of data + 4344, # behavior change ], }, { 'cflags': [ From 9d3b91124a48e6872259e809ebc831890c3af256 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 8 Aug 2014 01:34:38 +0000 Subject: [PATCH 049/194] 2.1.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 83a6e75e..76d76260 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "2.1.3", + "version": "2.1.4", "licenses": [ { "type": "MIT", From f1aa72ad960abcfe86d0504d7938d6dbc16ae567 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Fri, 22 Aug 2014 02:04:17 +0800 Subject: [PATCH 050/194] make CI build faster --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3299d793..b87f3bdc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,3 +7,6 @@ notifications: node_js: - "0.10" + +git: + depth: 10 From 3b07f364bf29e70ec16b0e5813c3fbfa3e0685ee Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 25 Sep 2014 09:18:18 -0700 Subject: [PATCH 051/194] Upgrade to libgit2 0.21.1 --- deps/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libgit2 b/deps/libgit2 index 28f087c8..b4d00c1d 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit 28f087c8642ff9c8dd6964e101e6d8539db6281a +Subproject commit b4d00c1d2466de3558a7cc6983dce4eb2ee98431 From 3d29dba60feb227990f078a4ffbde09a43b7e733 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 2 Oct 2014 09:12:57 -0700 Subject: [PATCH 052/194] 2.1.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 76d76260..33df6e52 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "2.1.4", + "version": "2.1.5", "licenses": [ { "type": "MIT", From e9ce83a714f7b8cc4c298b47a1776eb5b446b926 Mon Sep 17 00:00:00 2001 From: Samuel Mueller Date: Wed, 12 Nov 2014 11:15:45 +0100 Subject: [PATCH 053/194] extract function GetBlob --- src/repository.cc | 118 +++++++++++++++++++++++++--------------------- src/repository.h | 4 ++ 2 files changed, 69 insertions(+), 53 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index e8719be6..8afce3c6 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -78,6 +78,69 @@ git_repository* Repository::GetRepository(_NAN_METHOD_ARGS_TYPE args) { return node::ObjectWrap::Unwrap(args.This())->repository; } +int Repository::GetBlob(_NAN_METHOD_ARGS_TYPE args, + git_repository* repo, git_blob*& blob) { + std::string path(*String::Utf8Value(args[0])); + + int useIndex = false; + if (args.Length() >= 3) { + Local optionsArg(Local::Cast(args[2])); + if (optionsArg->Get(NanNew("useIndex"))->BooleanValue()) + useIndex = true; + } + + if (useIndex) { + git_index* index; + if (git_repository_index(&index, repo) != GIT_OK) + return -1; + + git_index_read(index, 0); + const git_index_entry* entry = git_index_get_bypath(index, path.data(), 0); + if (entry == NULL) { + git_index_free(index); + return -1; + } + + const git_oid* blobSha = &entry->id; + if (blobSha != NULL && git_blob_lookup(&blob, repo, blobSha) != GIT_OK) + blob = NULL; + } else { + git_reference* head; + if (git_repository_head(&head, repo) != GIT_OK) + return -1; + + const git_oid* sha = git_reference_target(head); + git_commit* commit; + int commitStatus = git_commit_lookup(&commit, repo, sha); + git_reference_free(head); + if (commitStatus != GIT_OK) + return -1; + + git_tree* tree; + int treeStatus = git_commit_tree(&tree, commit); + git_commit_free(commit); + if (treeStatus != GIT_OK) + return -1; + + git_tree_entry* treeEntry; + if (git_tree_entry_bypath(&treeEntry, tree, path.c_str()) != GIT_OK) { + git_tree_free(tree); + return -1; + } + + const git_oid* blobSha = git_tree_entry_id(treeEntry); + if (blobSha != NULL && git_blob_lookup(&blob, repo, blobSha) != GIT_OK) + blob = NULL; + git_tree_entry_free(treeEntry); + git_tree_free(tree); + } + + if (blob == NULL) + return -1; + + return 0; +} + // C++ equivalent to GIT_DIFF_OPTIONS_INIT, we can not use it directly because // of C++'s strong typing. git_diff_options Repository::CreateDefaultGitDiffOptions() { @@ -553,66 +616,15 @@ NAN_METHOD(Repository::GetLineDiffs) { if (args.Length() < 2) NanReturnNull(); - std::string path(*String::Utf8Value(args[0])); std::string text(*String::Utf8Value(args[1])); git_repository* repo = GetRepository(args); - int useIndex = false; - if (args.Length() >= 3) { - Local optionsArg(Local::Cast(args[2])); - if (optionsArg->Get(NanNew("useIndex"))->BooleanValue()) - useIndex = true; - } - git_blob* blob = NULL; - if (useIndex) { - git_index* index; - if (git_repository_index(&index, repo) != GIT_OK) - NanReturnNull(); - - git_index_read(index, 0); - const git_index_entry* entry = git_index_get_bypath(index, path.data(), 0); - if (entry == NULL) { - git_index_free(index); - NanReturnNull(); - } - - const git_oid* blobSha = &entry->id; - if (blobSha != NULL && git_blob_lookup(&blob, repo, blobSha) != GIT_OK) - blob = NULL; - } else { - git_reference* head; - if (git_repository_head(&head, repo) != GIT_OK) - NanReturnNull(); - const git_oid* sha = git_reference_target(head); - git_commit* commit; - int commitStatus = git_commit_lookup(&commit, repo, sha); - git_reference_free(head); - if (commitStatus != GIT_OK) - NanReturnNull(); + int getBlobResult = GetBlob(args, repo, blob); - git_tree* tree; - int treeStatus = git_commit_tree(&tree, commit); - git_commit_free(commit); - if (treeStatus != GIT_OK) - NanReturnNull(); - - git_tree_entry* treeEntry; - if (git_tree_entry_bypath(&treeEntry, tree, path.c_str()) != GIT_OK) { - git_tree_free(tree); - NanReturnNull(); - } - - const git_oid* blobSha = git_tree_entry_id(treeEntry); - if (blobSha != NULL && git_blob_lookup(&blob, repo, blobSha) != GIT_OK) - blob = NULL; - git_tree_entry_free(treeEntry); - git_tree_free(tree); - } - - if (blob == NULL) + if (getBlobResult != 0) NanReturnNull(); std::vector ranges; diff --git a/src/repository.h b/src/repository.h index cff7ce06..d316a17a 100644 --- a/src/repository.h +++ b/src/repository.h @@ -73,6 +73,10 @@ class Repository : public node::ObjectWrap { static git_repository* GetRepository(_NAN_METHOD_ARGS_TYPE args); + static int GetBlob(_NAN_METHOD_ARGS_TYPE args, + git_repository* repo, git_blob*& blob); + + static git_diff_options CreateDefaultGitDiffOptions(); explicit Repository(Handle path); From 0cb8e48db9fb46621ec1e91d265ef852b780396b Mon Sep 17 00:00:00 2001 From: Samuel Mueller Date: Wed, 12 Nov 2014 11:23:47 +0100 Subject: [PATCH 054/194] implement getLineDiffDetails --- src/repository.cc | 79 +++++++++++++++++++++++++++++++++++++++++++++++ src/repository.h | 5 +++ 2 files changed, 84 insertions(+) diff --git a/src/repository.cc b/src/repository.cc index 8afce3c6..43c49af2 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -58,6 +58,7 @@ void Repository::Init(Handle target) { NODE_SET_METHOD(proto, "getMergeBase", Repository::GetMergeBase); NODE_SET_METHOD(proto, "_release", Repository::Release); NODE_SET_METHOD(proto, "getLineDiffs", Repository::GetLineDiffs); + NODE_SET_METHOD(proto, "getLineDiffDetails", Repository::GetLineDiffDetails); NODE_SET_METHOD(proto, "getReferences", Repository::GetReferences); NODE_SET_METHOD(proto, "checkoutRef", Repository::CheckoutReference); NODE_SET_METHOD(proto, "add", Repository::Add); @@ -662,6 +663,84 @@ NAN_METHOD(Repository::GetLineDiffs) { } } +struct LineDiff { + git_diff_hunk hunk; + git_diff_line line; +}; + +int Repository::DiffLineCallback(const git_diff_delta* delta, + const git_diff_hunk* range, + const git_diff_line* line, + void* payload) { + LineDiff lineDiff; + lineDiff.hunk = *range; + lineDiff.line = *line; + std::vector * lineDiffs = + static_cast*>(payload); + lineDiffs->push_back(lineDiff); + return GIT_OK; +} + +NAN_METHOD(Repository::GetLineDiffDetails) { + NanScope(); + if (args.Length() < 2) + NanReturnNull(); + + std::string text(*String::Utf8Value(args[1])); + + git_repository* repo = GetRepository(args); + + git_blob* blob = NULL; + + int getBlobResult = GetBlob(args, repo, blob); + + if (getBlobResult != 0) + NanReturnNull(); + + std::vector lineDiffs; + git_diff_options options = CreateDefaultGitDiffOptions(); + + // Set GIT_DIFF_IGNORE_WHITESPACE_EOL when ignoreEolWhitespace: true + if (args.Length() >= 3) { + Local optionsArg(Local::Cast(args[2])); + if (optionsArg->Get(NanNew("ignoreEolWhitespace"))->BooleanValue()) + options.flags = GIT_DIFF_IGNORE_WHITESPACE_EOL; + } + + options.context_lines = 0; + if (git_diff_blob_to_buffer(blob, NULL, text.data(), text.length(), NULL, + &options, NULL, NULL, DiffLineCallback, + &lineDiffs) == GIT_OK) { + Local v8Ranges = NanNew(lineDiffs.size()); + for (size_t i = 0; i < lineDiffs.size(); i++) { + Local v8Range = NanNew(); + + v8Range->Set(NanNew("oldLineNo"), + NanNew(lineDiffs[i].line.old_lineno)); + v8Range->Set(NanNew("newLineNo"), + NanNew(lineDiffs[i].line.new_lineno)); + v8Range->Set(NanNew("oldStart"), + NanNew(lineDiffs[i].hunk.old_start)); + v8Range->Set(NanNew("newStart"), + NanNew(lineDiffs[i].hunk.new_start)); + v8Range->Set(NanNew("oldLines"), + NanNew(lineDiffs[i].hunk.old_lines)); + v8Range->Set(NanNew("newLines"), + NanNew(lineDiffs[i].hunk.new_lines)); + v8Range->Set(NanNew("line"), + NanNew(lineDiffs[i].line.content, + lineDiffs[i].line.content_len)); + + v8Ranges->Set(i, v8Range); + } + git_blob_free(blob); + NanReturnValue(v8Ranges); + } else { + git_blob_free(blob); + NanReturnNull(); + } +} + Handle Repository::ConvertStringVectorToV8Array( const std::vector& vector) { size_t i = 0, size = vector.size(); diff --git a/src/repository.h b/src/repository.h index d316a17a..bcc459b8 100644 --- a/src/repository.h +++ b/src/repository.h @@ -55,6 +55,7 @@ class Repository : public node::ObjectWrap { static NAN_METHOD(GetMergeBase); static NAN_METHOD(Release); static NAN_METHOD(GetLineDiffs); + static NAN_METHOD(GetLineDiffDetails); static NAN_METHOD(GetReferences); static NAN_METHOD(CheckoutReference); static NAN_METHOD(Add); @@ -64,6 +65,10 @@ class Repository : public node::ObjectWrap { static int DiffHunkCallback(const git_diff_delta *delta, const git_diff_hunk *hunk, void *payload); + static int DiffLineCallback(const git_diff_delta *delta, + const git_diff_hunk *hunk, + const git_diff_line *line, + void *payload); static int SubmoduleCallback(git_submodule *submodule, const char *name, void *payload); From 49275ef83b551b86b316e91a6ed8bd6e29ce6f8f Mon Sep 17 00:00:00 2001 From: Samuel Mueller Date: Wed, 12 Nov 2014 12:42:36 +0100 Subject: [PATCH 055/194] implement specs --- spec/git-spec.coffee | 68 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 3b6a9d27..d263b4cd 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -492,6 +492,74 @@ describe "git", -> diffs = repo.getLineDiffs('a.txt', 'first line is different', useIndex: false) expect(diffs.length).toBe 1 + describe '.getLineDiffDetailss(path, text, options)', -> + it 'returns all relevant lines in a diff', -> + repo = git.open(path.join(__dirname, 'fixtures/master.git')) + + isOldLine = (diff) -> + diff.oldLineNo >= 0 and diff.newLineNo is -1 + + isNewLine = (diff) -> + diff.oldLineNo is -1 and diff.newLineNo >= 0 + + diffs = repo.getLineDiffDetails('a.txt', 'first line is different') + expect(diffs.length).toBe 3 + expect(isOldLine(diffs[0])).toBe true + expect(diffs[0].line).toEqual 'first line\n' + expect(isNewLine(diffs[1])).toBe true + expect(diffs[1].line).toEqual 'first line is different' + + diffs = repo.getLineDiffDetails('a.txt', 'first line\nsecond line') + expect(diffs.length).toBe 2 + expect(isNewLine(diffs[0])).toBe true + expect(diffs[0].line).toEqual 'second line' + + diffs = repo.getLineDiffDetails('a.txt', '') + expect(diffs.length).toBe 1 + expect(isOldLine(diffs[0])).toBe true + expect(diffs[0].line).toEqual 'first line\n' + + it "returns null for paths that don't exist", -> + repo = git.open(path.join(__dirname, 'fixtures/master.git')) + + diffs = repo.getLineDiffDetails('i-dont-exists.txt', 'content') + expect(diffs).toBeNull() + + describe "ignoreEolWhitespace option", -> + it "ignores eol of line whitespace changes", -> + repo = git.open(path.join(__dirname, 'fixtures/whitespace.git')) + + diffs = repo.getLineDiffDetails('file.txt', 'first\r\nsecond\r\nthird\r\n', ignoreEolWhitespace: false) + expect(diffs.length).toBe 6 + + diffs = repo.getLineDiffs('file.txt', 'first\r\nsecond\r\nthird\r\n', ignoreEolWhitespace: true) + expect(diffs.length).toBe 0 + + describe "useIndex options", -> + it "uses the index version instead of the HEAD version for diffs", -> + repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + + diffs = repo.getLineDiffDetails('a.txt', 'first line is different', useIndex: true) + expect(diffs.length).toBe 3 + + filePath = path.join(repo.getWorkingDirectory(), 'a.txt') + fs.writeFileSync(filePath, 'first line is different', 'utf8') + + gitCommandHandler = jasmine.createSpy('gitCommandHandler') + execCommands ["cd #{repoDirectory}", "git add a.txt"], gitCommandHandler + + waitsFor -> + gitCommandHandler.callCount is 1 + + runs -> + diffs = repo.getLineDiffDetails('a.txt', 'first line is different', useIndex: true) + expect(diffs.length).toBe 0 + + diffs = repo.getLineDiffDetails('a.txt', 'first line is different', useIndex: false) + expect(diffs.length).toBe 3 + describe '.relativize(path)', -> it 'relativizes the given path to the working directory of the repository', -> repo = git.open(__dirname) From 0dbe60abc3115109cae7ee76e29305bd31080f4e Mon Sep 17 00:00:00 2001 From: Samuel Mueller Date: Wed, 12 Nov 2014 12:44:45 +0100 Subject: [PATCH 056/194] :lipstick: --- src/repository.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/repository.h b/src/repository.h index bcc459b8..9e913795 100644 --- a/src/repository.h +++ b/src/repository.h @@ -75,13 +75,11 @@ class Repository : public node::ObjectWrap { static Handle ConvertStringVectorToV8Array( const std::vector& vector); - static git_repository* GetRepository(_NAN_METHOD_ARGS_TYPE args); static int GetBlob(_NAN_METHOD_ARGS_TYPE args, git_repository* repo, git_blob*& blob); - static git_diff_options CreateDefaultGitDiffOptions(); explicit Repository(Handle path); From a745962f4a7a85e3fa28d320f1690ecff1b39d4b Mon Sep 17 00:00:00 2001 From: Samuel Mueller Date: Tue, 18 Nov 2014 00:09:47 +0100 Subject: [PATCH 057/194] add documentation --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 33ed39a1..c00e34eb 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,15 @@ text. Returns an array of objects that have `oldStart`, `oldLines`, `newStart`, and `newLines` keys pointing to integer values, may be `null` if the diff fails. +### Repository.getLineDiffDetails(path, text, [options]) + +Get the line diff details comparing the HEAD version of the given path and the given +text. + +Takes the same arguments as `getLineDiffs`. + +Returns an array of objects which represent an old or new line in a diff. Every object has `oldStart`, `oldLines`, `newStart`, `newLines`, `oldLineNo` and `newLineNo` keys pointing to integer values, and a `line` key pointing to the respective line content. May be `null` if the diff fails. + ### Repository.getMergeBase(commit1, commit2) Get the merge base of two commits. From f14f7e5ae294661c7e5b526d1cf00a84fe389934 Mon Sep 17 00:00:00 2001 From: Samuel Mueller Date: Tue, 18 Nov 2014 00:24:16 +0100 Subject: [PATCH 058/194] :lipstick: --- spec/git-spec.coffee | 2 +- src/repository.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index d263b4cd..e015bcf6 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -492,7 +492,7 @@ describe "git", -> diffs = repo.getLineDiffs('a.txt', 'first line is different', useIndex: false) expect(diffs.length).toBe 1 - describe '.getLineDiffDetailss(path, text, options)', -> + describe '.getLineDiffDetails(path, text, options)', -> it 'returns all relevant lines in a diff', -> repo = git.open(path.join(__dirname, 'fixtures/master.git')) diff --git a/src/repository.cc b/src/repository.cc index 43c49af2..fef0bca1 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -80,7 +80,7 @@ git_repository* Repository::GetRepository(_NAN_METHOD_ARGS_TYPE args) { } int Repository::GetBlob(_NAN_METHOD_ARGS_TYPE args, - git_repository* repo, git_blob*& blob) { + git_repository* repo, git_blob*& blob) { std::string path(*String::Utf8Value(args[0])); int useIndex = false; From c9b8341cd44540f8ee91b71740a824e8083b5404 Mon Sep 17 00:00:00 2001 From: Jason Koenig Date: Sat, 6 Dec 2014 15:00:48 -0800 Subject: [PATCH 059/194] Add status query for staged files This allows clients to determine whether a path is in git's index. --- src/git.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/git.coffee b/src/git.coffee index 5a9439d3..05b6e8bf 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -21,6 +21,10 @@ newStatusFlags = statusWorkingDirNew | statusIndexNew deletedStatusFlags = statusWorkingDirDelete | statusIndexDeleted +indexStatusFlags = statusIndexNew | statusIndexModified | + statusIndexDeleted | statusIndexRenamed | + statusIndexTypeChange + Repository::release = -> submoduleRepo?.release() for submodulePath, submoduleRepo of @submodules @_release() @@ -58,6 +62,9 @@ Repository::isPathDeleted = (path) -> Repository::isStatusIgnored = (status=0) -> (status & statusIgnored) > 0 +Repository::isStatusStaged = (status=0) -> + (status & indexStatusFlags) > 0 + Repository::getUpstreamBranch = (branch) -> branch ?= @getHead() return null unless branch?.length > 11 From 14e20ce57d393bce3bc36dc7f07e6908bc4c87c0 Mon Sep 17 00:00:00 2001 From: Jason Koenig Date: Sun, 7 Dec 2014 21:41:40 -0800 Subject: [PATCH 060/194] Fix Repository::Add to write index changes to disk Without this, changes are not visible outside of the node process, and seem to be lost. This makes the changes persistent. --- src/repository.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index e8719be6..2a7cc9c0 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -774,7 +774,7 @@ NAN_METHOD(Repository::Add) { else return NanThrowError("Unknown error opening index"); } - + // Modify the in-memory index. if (git_index_add_bypath(index, path.c_str()) != GIT_OK) { git_index_free(index); const git_error* e = giterr_last(); @@ -783,7 +783,15 @@ NAN_METHOD(Repository::Add) { else return NanThrowError("Unknown error adding path to index"); } - + // Write this change in the index back to disk, so it is persistent + if (git_index_write(index) != GIT_OK) { + git_index_free(index); + const git_error* e = giterr_last(); + if (e != NULL) + return NanThrowError(e->message); + else + return NanThrowError("Unknown error adding path to index"); + } git_index_free(index); NanReturnValue(NanNew(true)); } From b2be5ddb52ecb94fb37dc84adcefb0c9a84a7052 Mon Sep 17 00:00:00 2001 From: Samuel Mueller Date: Wed, 10 Dec 2014 21:57:19 +0100 Subject: [PATCH 061/194] hard-wrap line in the readme --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c00e34eb..b5692ce0 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,10 @@ text. Takes the same arguments as `getLineDiffs`. -Returns an array of objects which represent an old or new line in a diff. Every object has `oldStart`, `oldLines`, `newStart`, `newLines`, `oldLineNo` and `newLineNo` keys pointing to integer values, and a `line` key pointing to the respective line content. May be `null` if the diff fails. +Returns an array of objects which represent an old or new line in a diff. Every +object has `oldStart`, `oldLines`, `newStart`, `newLines`, `oldLineNo` and `newLineNo` +keys pointing to integer values, and a `line` key pointing to the respective line +content. May be `null` if the diff fails. ### Repository.getMergeBase(commit1, commit2) From 415b8b90daeb6ee79536997fcdfdaeebd3be8c9f Mon Sep 17 00:00:00 2001 From: Samuel Mueller Date: Wed, 10 Dec 2014 22:00:36 +0100 Subject: [PATCH 062/194] rename xxxLineNo -> xxxLineNumber --- README.md | 6 +++--- spec/git-spec.coffee | 4 ++-- src/repository.cc | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b5692ce0..1243957e 100644 --- a/README.md +++ b/README.md @@ -153,9 +153,9 @@ text. Takes the same arguments as `getLineDiffs`. Returns an array of objects which represent an old or new line in a diff. Every -object has `oldStart`, `oldLines`, `newStart`, `newLines`, `oldLineNo` and `newLineNo` -keys pointing to integer values, and a `line` key pointing to the respective line -content. May be `null` if the diff fails. +object has `oldStart`, `oldLines`, `newStart`, `newLines`, `oldLineNumber` and +`newLineNumber` keys pointing to integer values, and a `line` key pointing to the +respective line content. May be `null` if the diff fails. ### Repository.getMergeBase(commit1, commit2) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index e015bcf6..0e77cb72 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -497,10 +497,10 @@ describe "git", -> repo = git.open(path.join(__dirname, 'fixtures/master.git')) isOldLine = (diff) -> - diff.oldLineNo >= 0 and diff.newLineNo is -1 + diff.oldLineNumber >= 0 and diff.newLineNumber is -1 isNewLine = (diff) -> - diff.oldLineNo is -1 and diff.newLineNo >= 0 + diff.oldLineNumber is -1 and diff.newLineNumber >= 0 diffs = repo.getLineDiffDetails('a.txt', 'first line is different') expect(diffs.length).toBe 3 diff --git a/src/repository.cc b/src/repository.cc index fef0bca1..885c1553 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -715,9 +715,9 @@ NAN_METHOD(Repository::GetLineDiffDetails) { for (size_t i = 0; i < lineDiffs.size(); i++) { Local v8Range = NanNew(); - v8Range->Set(NanNew("oldLineNo"), + v8Range->Set(NanNew("oldLineNumber"), NanNew(lineDiffs[i].line.old_lineno)); - v8Range->Set(NanNew("newLineNo"), + v8Range->Set(NanNew("newLineNumber"), NanNew(lineDiffs[i].line.new_lineno)); v8Range->Set(NanNew("oldStart"), NanNew(lineDiffs[i].hunk.old_start)); From fc2ecebf6d90c78d7ab85dfd41385c961b94fecf Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 12 Dec 2014 12:40:39 -0800 Subject: [PATCH 063/194] :arrow_up: libgit2@0.21.2 --- deps/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libgit2 b/deps/libgit2 index b4d00c1d..4af08d9f 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit b4d00c1d2466de3558a7cc6983dce4eb2ee98431 +Subproject commit 4af08d9f69f151f6362df51d7d7f41527e2af05c From c57b7a6cbed28f6d2e2c2361b6726236a85cc39c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 12 Dec 2014 12:42:44 -0800 Subject: [PATCH 064/194] :memo: Doc Repository.isStatusStaged --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 1243957e..951c84a6 100644 --- a/README.md +++ b/README.md @@ -285,6 +285,14 @@ Check if a status value represents a deleted path. Returns `true` if the status is a deleted one, `false` otherwise. +### Repository.isStatusStaged(status) + +Check if a status value represents a changed that is staged in the index. + +`status` - The integer status value. + +Returns `true` if the status is a staged one, `false` otherwise. + ### Repository.isSubmodule(path) Check if the path is a submodule in the index. From 9c124aa75fe260d6d0ca96d375b70de5226204c5 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 12 Dec 2014 12:54:37 -0800 Subject: [PATCH 065/194] Add Repository::isPathStaged --- README.md | 8 ++++++++ spec/git-spec.coffee | 34 ++++++++++++++++++++++++++++++++++ src/git.coffee | 3 +++ 3 files changed, 45 insertions(+) diff --git a/README.md b/README.md index 951c84a6..e5529eac 100644 --- a/README.md +++ b/README.md @@ -253,6 +253,14 @@ Get the deleted status of a given path. Returns `true` if the path is deleted, `false` otherwise. +### Repository.isPathStaged(path) + +Get the staged status of a given path. + +`path` - The string repository-relative path. + +Returns `true` if the path is staged in the index, `false` otherwise. + ### Repository.isStatusIgnored(status) Check if a status value represents an ignored path. diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 0e77cb72..69770e14 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -177,6 +177,40 @@ describe "git", -> fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new.txt'), 'new', 'utf8') expect(repo.isPathNew('new.txt')).toBe true + describe 'isPathStaged(path)', -> + [repoDirectory] = [] + + beforeEach -> + repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + + describe 'when a path is new and staged', -> + it 'returns true ', -> + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new.txt'), 'new', 'utf8') + expect(repo.isPathStaged('new.txt')).toBe false + repo.add('new.txt') + expect(repo.isPathStaged('new.txt')).toBe true + + describe 'when a path is modified and staged', -> + it 'returns true ', -> + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'a.txt'), 'changing a.txt', 'utf8') + expect(repo.isPathStaged('a.txt')).toBe false + repo.add('a.txt') + expect(repo.isPathStaged('a.txt')).toBe true + + describe 'when a path is deleted and staged', -> + it 'returns true ', -> + expect(repo.isPathStaged('a.txt')).toBe false + gitCommandHandler = jasmine.createSpy('gitCommandHandler') + execCommands ["cd #{repoDirectory}", "git rm -f a.txt"], gitCommandHandler + + waitsFor -> + gitCommandHandler.callCount is 1 + + runs -> + expect(repo.isPathStaged('a.txt')).toBe true + describe '.isStatusIgnored(status)', -> it 'returns true when the status is ignored, false otherwise', -> repoDirectory = temp.mkdirSync('node-git-repo-') diff --git a/src/git.coffee b/src/git.coffee index 05b6e8bf..5924bce5 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -59,6 +59,9 @@ Repository::isStatusDeleted = (status=0) -> Repository::isPathDeleted = (path) -> @isStatusDeleted(@getStatus(path)) +Repository::isPathStaged = (path) -> + @isStatusStaged(@getStatus(path)) + Repository::isStatusIgnored = (status=0) -> (status & statusIgnored) > 0 From 5d32cca16604a5fb39cca3c9b9d412961c62df99 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 12 Dec 2014 12:55:57 -0800 Subject: [PATCH 066/194] 2.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 33df6e52..1f087d7d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "2.1.5", + "version": "2.2.0", "licenses": [ { "type": "MIT", From 057a8dbbaf660964fba40630bc18ccdcb68c1b9b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 15 Jan 2015 16:07:14 -0800 Subject: [PATCH 067/194] :lipstick: --- src/git.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git.coffee b/src/git.coffee index 5924bce5..447014c4 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -1,6 +1,6 @@ path = require 'path' fs = require 'fs-plus' -{Repository} = require('../build/Release/git.node') +{Repository} = require '../build/Release/git.node' statusIndexNew = 1 << 0 statusIndexModified = 1 << 1 From 1db13dcb5b45e232d874eb98e904b44c6946bc20 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 27 Jan 2015 15:50:23 -0800 Subject: [PATCH 068/194] :arrow_up: nan@1.6.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1f087d7d..e4083f8b 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "grunt-coffeelint": "0.0.6" }, "dependencies": { - "nan": "1.2.0", + "nan": "https://atom.io/download/atom-shell/nan-1.6.1.tgz", "fs-plus": "^2.1.0" }, "scripts": { From 98253dbbf4c1f97ac283f55833a249ceea4bd2d1 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 27 Jan 2015 16:14:11 -0800 Subject: [PATCH 069/194] 2.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e4083f8b..21ea121d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "2.2.0", + "version": "2.3.0", "licenses": [ { "type": "MIT", From 69df8e701a99ef946d17dd6e466e4256512fb598 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 28 Jan 2015 13:24:36 -0800 Subject: [PATCH 070/194] 3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 21ea121d..97d84bae 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "2.3.0", + "version": "3.0.0", "licenses": [ { "type": "MIT", From 61a610cbfc7b075c3f046ab8ccd14192a0d5b3cc Mon Sep 17 00:00:00 2001 From: "Samuel E. Giddins" Date: Fri, 5 Jun 2015 12:33:56 -0700 Subject: [PATCH 071/194] Working dir should relativize to an empty string --- spec/git-spec.coffee | 1 + src/git.coffee | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 69770e14..1c001efe 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -606,6 +606,7 @@ describe "git", -> expect(repo.relativize(null)).toBe null expect(repo.relativize()).toBeUndefined() expect(repo.relativize('')).toBe '' + expect(repo.relativize(workingDirectory)).toBe '' describe 'when the opened path is a symlink', -> it 'relativizes against both the linked path and the real path', -> diff --git a/src/git.coffee b/src/git.coffee index 447014c4..d1927a19 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -128,18 +128,28 @@ Repository::relativize = (path) -> workingDirectory = workingDirectory.toLowerCase() if lowerCasePath.indexOf("#{workingDirectory}/") is 0 return path.substring(workingDirectory.length + 1) + else if lowerCasePath is workingDirectory + return '' if @openedWorkingDirectory workingDirectory = @openedWorkingDirectory.toLowerCase() if lowerCasePath.indexOf("#{workingDirectory}/") is 0 return path.substring(workingDirectory.length + 1) + else if lowerCasePath is workingDirectory + return '' else workingDirectory = @getWorkingDirectory() - if workingDirectory and path.indexOf("#{workingDirectory}/") is 0 - return path.substring(workingDirectory.length + 1) + if workingDirectory + if path.indexOf("#{workingDirectory}/") is 0 + return path.substring(workingDirectory.length + 1) + else if path is workingDirectory + return '' - if @openedWorkingDirectory and path.indexOf("#{@openedWorkingDirectory}/") is 0 - return path.substring(@openedWorkingDirectory.length + 1) + if @openedWorkingDirectory + if path.indexOf("#{@openedWorkingDirectory}/") is 0 + return path.substring(@openedWorkingDirectory.length + 1) + else if path is @openedWorkingDirectory + return '' path From 6a980ed023ade8a5c2976d098a2f1e23db032a03 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 9 Jun 2015 08:52:03 -0700 Subject: [PATCH 072/194] 3.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 97d84bae..a50e2655 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "3.0.0", + "version": "3.0.1", "licenses": [ { "type": "MIT", From 3d263eb7682fe3c0237506efba8de5fa21fe0262 Mon Sep 17 00:00:00 2001 From: Machiste Quintana Date: Tue, 4 Aug 2015 07:39:13 -0400 Subject: [PATCH 073/194] Only build pushes on Travis for master branch [ci skip] --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index b87f3bdc..fd26d031 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,3 +10,7 @@ node_js: git: depth: 10 + +branches: + only: + - master From 86d90b787c1d0da27db0260ced9e53db9131c5bd Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Thu, 3 Sep 2015 14:47:15 -0400 Subject: [PATCH 074/194] Spec for libgit2 gitignore bug. --- spec/fixtures/ignored-workspace/.gitignore | 0 .../ignored-workspace/subdir/.gitignore | 1 + spec/git-spec.coffee | 21 ++++++++++++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 spec/fixtures/ignored-workspace/.gitignore create mode 100644 spec/fixtures/ignored-workspace/subdir/.gitignore diff --git a/spec/fixtures/ignored-workspace/.gitignore b/spec/fixtures/ignored-workspace/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/ignored-workspace/subdir/.gitignore b/spec/fixtures/ignored-workspace/subdir/.gitignore new file mode 100644 index 00000000..80034a11 --- /dev/null +++ b/spec/fixtures/ignored-workspace/subdir/.gitignore @@ -0,0 +1 @@ +subdir diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 1c001efe..88cc5d41 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -65,20 +65,35 @@ describe "git", -> expect(repo.getShortHead()).toBe '50719ab' describe ".isIgnored(path)", -> + [ignoreRepoRoot, ignoreRepoDir] = [] + + beforeEach -> + # this setup should be done in beforeAll, but jasmine 1.x doesn't have it. + ignoreRepoRoot = temp.mkdirSync("ignore-dir") + ignoreRepoDir = path.join(ignoreRepoRoot, "ignored") + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/ignored-workspace/'), ignoreRepoDir) + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/ignored.git'), path.join(ignoreRepoDir, '.git')) + + afterEach -> + wrench.rmdirSyncRecursive(ignoreRepoRoot) + describe "when the path is undefined", -> it "return false", -> - repo = git.open(path.join(__dirname, 'fixtures/ignored.git')) + repo = git.open(ignoreRepoDir) expect(repo.isIgnored()).toBe false describe "when the path is ignored", -> it "returns true", -> - repo = git.open(path.join(__dirname, 'fixtures/ignored.git')) + repo = git.open(ignoreRepoDir) expect(repo.isIgnored('a.txt')).toBe true + expect(repo.isIgnored('subdir/subdir')).toBe true describe "when the path is not ignored", -> it "return false", -> - repo = git.open(path.join(__dirname, 'fixtures/ignored.git')) + repo = git.open(ignoreRepoDir) expect(repo.isIgnored('b.txt')).toBe false + expect(repo.isIgnored('subdir')).toBe false + expect(repo.isIgnored('subdir/yak.txt')).toBe false describe ".isSubmodule(path)", -> describe "when the path is undefined", -> From 6ee186d9bb34686489d569f4efffb84ddf0fbee0 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Tue, 1 Sep 2015 22:10:45 -0400 Subject: [PATCH 075/194] Upgrade libgit2. This fixes gitignore processing bugs that have been fixed upstream. --- binding.gyp | 2 ++ deps/libgit2 | 2 +- src/repository.cc | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/binding.gyp b/binding.gyp index 7677a54c..a4493610 100644 --- a/binding.gyp +++ b/binding.gyp @@ -228,6 +228,8 @@ 'deps/libgit2/src/vector.h', 'deps/libgit2/src/zstream.c', 'deps/libgit2/src/zstream.h', + 'deps/libgit2/src/transports/auth.c', + 'deps/libgit2/src/transports/auth_negotiate.c', 'deps/libgit2/src/transports/cred.c', 'deps/libgit2/src/transports/cred_helpers.c', 'deps/libgit2/src/transports/git.c', diff --git a/deps/libgit2 b/deps/libgit2 index 4af08d9f..21e7015c 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit 4af08d9f69f151f6362df51d7d7f41527e2af05c +Subproject commit 21e7015ca3425e396c2b7cc03ac67e297a646c91 diff --git a/src/repository.cc b/src/repository.cc index 5ca28e71..02a3e432 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -29,7 +29,7 @@ void Repository::Init(Handle target) { NanScope(); - git_threads_init(); + git_libgit2_init(); Local newTemplate = NanNew( Repository::New); @@ -256,7 +256,7 @@ NAN_METHOD(Repository::GetConfigValue) { git_config* config; git_repository* repository = GetRepository(args); - if (git_repository_config(&config, repository) != GIT_OK) + if (git_repository_config_snapshot(&config, repository) != GIT_OK) NanReturnNull(); std::string configKey(*String::Utf8Value(args[0])); @@ -640,7 +640,7 @@ NAN_METHOD(Repository::GetLineDiffs) { options.context_lines = 0; if (git_diff_blob_to_buffer(blob, NULL, text.data(), text.length(), NULL, - &options, NULL, DiffHunkCallback, NULL, + &options, NULL, NULL, DiffHunkCallback, NULL, &ranges) == GIT_OK) { Local v8Ranges = NanNew(ranges.size()); for (size_t i = 0; i < ranges.size(); i++) { @@ -709,7 +709,7 @@ NAN_METHOD(Repository::GetLineDiffDetails) { options.context_lines = 0; if (git_diff_blob_to_buffer(blob, NULL, text.data(), text.length(), NULL, - &options, NULL, NULL, DiffLineCallback, + &options, NULL, NULL, NULL, DiffLineCallback, &lineDiffs) == GIT_OK) { Local v8Ranges = NanNew(lineDiffs.size()); for (size_t i = 0; i < lineDiffs.size(); i++) { @@ -788,7 +788,7 @@ int branch_checkout(git_repository* repo, const char* refName) { if (!(success = git_reference_lookup(&ref, repo, refName)) && !(success = git_reference_peel(&git_obj, ref, GIT_OBJ_TREE)) && !(success = git_checkout_tree(repo, git_obj, &opts))) - success = git_repository_set_head(repo, refName, NULL, NULL); + success = git_repository_set_head(repo, refName); git_object_free(git_obj); git_obj = NULL; @@ -836,7 +836,7 @@ NAN_METHOD(Repository::CheckoutReference) { std::string shortRefName(strRefName.c_str() + 11, kShortNameLength); int branchCreateStatus = git_branch_create( - &branch, repo, shortRefName.c_str(), commit, 0, NULL, NULL); + &branch, repo, shortRefName.c_str(), commit, 0); git_commit_free(commit); if (branchCreateStatus != GIT_OK) From 190962c06817d8d1298d65f30839056c52d644b0 Mon Sep 17 00:00:00 2001 From: Gabe Isenberg Date: Thu, 10 Sep 2015 18:51:09 -0700 Subject: [PATCH 076/194] Update nan package dependency from 1.6.1 to 2.0.0 --- package.json | 2 +- src/repository.cc | 555 ++++++++++++++++++++++++---------------------- src/repository.h | 12 +- 3 files changed, 296 insertions(+), 273 deletions(-) diff --git a/package.json b/package.json index a50e2655..887a33ef 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "grunt-coffeelint": "0.0.6" }, "dependencies": { - "nan": "https://atom.io/download/atom-shell/nan-1.6.1.tgz", + "nan": "^2.0.0", "fs-plus": "^2.1.0" }, "scripts": { diff --git a/src/repository.cc b/src/repository.cc index 5ca28e71..f5d401b8 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -26,67 +26,68 @@ #include #include -void Repository::Init(Handle target) { - NanScope(); - +void Repository::Init(Local target) { + Nan::HandleScope scope; git_threads_init(); - Local newTemplate = NanNew( + Local newTemplate = Nan::New( Repository::New); - newTemplate->SetClassName(NanNew("Repository")); + newTemplate->SetClassName(Nan::New("Repository").ToLocalChecked()); newTemplate->InstanceTemplate()->SetInternalFieldCount(1); Local proto = newTemplate->PrototypeTemplate(); - NODE_SET_METHOD(proto, "getPath", Repository::GetPath); - NODE_SET_METHOD(proto, "_getWorkingDirectory", + Nan::SetMethod(proto, "getPath", Repository::GetPath); + Nan::SetMethod(proto, "_getWorkingDirectory", Repository::GetWorkingDirectory); - NODE_SET_METHOD(proto, "exists", Repository::Exists); - NODE_SET_METHOD(proto, "getSubmodulePaths", Repository::GetSubmodulePaths); - NODE_SET_METHOD(proto, "getHead", Repository::GetHead); - NODE_SET_METHOD(proto, "refreshIndex", Repository::RefreshIndex); - NODE_SET_METHOD(proto, "isIgnored", Repository::IsIgnored); - NODE_SET_METHOD(proto, "isSubmodule", Repository::IsSubmodule); - NODE_SET_METHOD(proto, "getConfigValue", Repository::GetConfigValue); - NODE_SET_METHOD(proto, "setConfigValue", Repository::SetConfigValue); - NODE_SET_METHOD(proto, "getStatus", Repository::GetStatus); - NODE_SET_METHOD(proto, "checkoutHead", Repository::CheckoutHead); - NODE_SET_METHOD(proto, "getReferenceTarget", Repository::GetReferenceTarget); - NODE_SET_METHOD(proto, "getDiffStats", Repository::GetDiffStats); - NODE_SET_METHOD(proto, "getIndexBlob", Repository::GetIndexBlob); - NODE_SET_METHOD(proto, "getHeadBlob", Repository::GetHeadBlob); - NODE_SET_METHOD(proto, "getCommitCount", Repository::GetCommitCount); - NODE_SET_METHOD(proto, "getMergeBase", Repository::GetMergeBase); - NODE_SET_METHOD(proto, "_release", Repository::Release); - NODE_SET_METHOD(proto, "getLineDiffs", Repository::GetLineDiffs); - NODE_SET_METHOD(proto, "getLineDiffDetails", Repository::GetLineDiffDetails); - NODE_SET_METHOD(proto, "getReferences", Repository::GetReferences); - NODE_SET_METHOD(proto, "checkoutRef", Repository::CheckoutReference); - NODE_SET_METHOD(proto, "add", Repository::Add); - - target->Set(NanNew("Repository"), newTemplate->GetFunction()); + Nan::SetMethod(proto, "exists", Repository::Exists); + Nan::SetMethod(proto, "getSubmodulePaths", Repository::GetSubmodulePaths); + Nan::SetMethod(proto, "getHead", Repository::GetHead); + Nan::SetMethod(proto, "refreshIndex", Repository::RefreshIndex); + Nan::SetMethod(proto, "isIgnored", Repository::IsIgnored); + Nan::SetMethod(proto, "isSubmodule", Repository::IsSubmodule); + Nan::SetMethod(proto, "getConfigValue", Repository::GetConfigValue); + Nan::SetMethod(proto, "setConfigValue", Repository::SetConfigValue); + Nan::SetMethod(proto, "getStatus", Repository::GetStatus); + Nan::SetMethod(proto, "checkoutHead", Repository::CheckoutHead); + Nan::SetMethod(proto, "getReferenceTarget", Repository::GetReferenceTarget); + Nan::SetMethod(proto, "getDiffStats", Repository::GetDiffStats); + Nan::SetMethod(proto, "getIndexBlob", Repository::GetIndexBlob); + Nan::SetMethod(proto, "getHeadBlob", Repository::GetHeadBlob); + Nan::SetMethod(proto, "getCommitCount", Repository::GetCommitCount); + Nan::SetMethod(proto, "getMergeBase", Repository::GetMergeBase); + Nan::SetMethod(proto, "_release", Repository::Release); + Nan::SetMethod(proto, "getLineDiffs", Repository::GetLineDiffs); + Nan::SetMethod(proto, "getLineDiffDetails", Repository::GetLineDiffDetails); + Nan::SetMethod(proto, "getReferences", Repository::GetReferences); + Nan::SetMethod(proto, "checkoutRef", Repository::CheckoutReference); + Nan::SetMethod(proto, "add", Repository::Add); + + target->Set(Nan::New("Repository").ToLocalChecked(), + newTemplate->GetFunction()); } NODE_MODULE(git, Repository::Init) NAN_METHOD(Repository::New) { - NanScope(); - Repository* repository = new Repository(Local::Cast(args[0])); - repository->Wrap(args.This()); - NanReturnUndefined(); + Nan::HandleScope scope; + Repository* repository = new Repository(Local::Cast(info[0])); + repository->Wrap(info.This()); + info.GetReturnValue().SetUndefined(); } -git_repository* Repository::GetRepository(_NAN_METHOD_ARGS_TYPE args) { - return node::ObjectWrap::Unwrap(args.This())->repository; +git_repository* Repository::GetRepository(Nan::NAN_METHOD_ARGS_TYPE args) { + return Nan::ObjectWrap::Unwrap(args.This())->repository; } -int Repository::GetBlob(_NAN_METHOD_ARGS_TYPE args, +int Repository::GetBlob(Nan::NAN_METHOD_ARGS_TYPE args, git_repository* repo, git_blob*& blob) { std::string path(*String::Utf8Value(args[0])); int useIndex = false; if (args.Length() >= 3) { Local optionsArg(Local::Cast(args[2])); - if (optionsArg->Get(NanNew("useIndex"))->BooleanValue()) + if (optionsArg->Get( + Nan::New("useIndex").ToLocalChecked())->BooleanValue()) useIndex = true; } @@ -152,41 +153,43 @@ git_diff_options Repository::CreateDefaultGitDiffOptions() { } NAN_METHOD(Repository::Exists) { - NanScope(); - NanReturnValue(NanNew(GetRepository(args) != NULL)); + Nan::HandleScope scope; + + info.GetReturnValue().Set(Nan::New(GetRepository(info) != NULL)); } NAN_METHOD(Repository::GetPath) { - NanScope(); - git_repository* repository = GetRepository(args); + Nan::HandleScope scope; + git_repository* repository = GetRepository(info); const char* path = git_repository_path(repository); - NanReturnValue(NanNew(path)); + + info.GetReturnValue().Set(Nan::New(path).ToLocalChecked()); } NAN_METHOD(Repository::GetWorkingDirectory) { - NanScope(); - git_repository* repository = GetRepository(args); + Nan::HandleScope scope; + git_repository* repository = GetRepository(info); const char* path = git_repository_workdir(repository); - NanReturnValue(NanNew(path)); + info.GetReturnValue().Set(Nan::New(path).ToLocalChecked()); } NAN_METHOD(Repository::GetSubmodulePaths) { - NanScope(); - git_repository* repository = GetRepository(args); + Nan::HandleScope scope; + git_repository* repository = GetRepository(info); std::vector paths; git_submodule_foreach(repository, SubmoduleCallback, &paths); - Local v8Paths = NanNew(paths.size()); + Local v8Paths = Nan::New(paths.size()); for (size_t i = 0; i < paths.size(); i++) - v8Paths->Set(i, NanNew(paths[i].data())); - NanReturnValue(v8Paths); + v8Paths->Set(i, Nan::New(paths[i].data()).ToLocalChecked()); + info.GetReturnValue().Set(v8Paths); } NAN_METHOD(Repository::GetHead) { - NanScope(); - git_repository* repository = GetRepository(args); + Nan::HandleScope scope; + git_repository* repository = GetRepository(info); git_reference* head; if (git_repository_head(&head, repository) != GIT_OK) - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); if (git_repository_head_detached(repository) == 1) { const git_oid* sha = git_reference_target(head); @@ -194,139 +197,141 @@ NAN_METHOD(Repository::GetHead) { char oid[GIT_OID_HEXSZ + 1]; git_oid_tostr(oid, GIT_OID_HEXSZ + 1, sha); git_reference_free(head); - NanReturnValue(NanNew(oid, -1)); + return info.GetReturnValue().Set(Nan::New(oid, -1) + .ToLocalChecked()); } } - Local referenceName = NanNew(git_reference_name(head)); + Local referenceName = Nan::New(git_reference_name(head)) + .ToLocalChecked(); git_reference_free(head); - NanReturnValue(referenceName); + return info.GetReturnValue().Set(referenceName); } NAN_METHOD(Repository::RefreshIndex) { - NanScope(); - git_repository* repository = GetRepository(args); + Nan::HandleScope scope; + git_repository* repository = GetRepository(info); git_index* index; if (git_repository_index(&index, repository) == GIT_OK) { git_index_read(index, 0); git_index_free(index); } - NanReturnUndefined(); + info.GetReturnValue().SetUndefined(); } NAN_METHOD(Repository::IsIgnored) { - NanScope(); - if (args.Length() < 1) - NanReturnValue(NanNew(false)); + Nan::HandleScope scope; + if (info.Length() < 1) + return info.GetReturnValue().Set(Nan::New(false)); - git_repository* repository = GetRepository(args); - std::string path(*String::Utf8Value(args[0])); + git_repository* repository = GetRepository(info); + std::string path(*String::Utf8Value(info[0])); int ignored; if (git_ignore_path_is_ignored(&ignored, repository, path.c_str()) == GIT_OK) - NanReturnValue(NanNew(ignored == 1)); + return info.GetReturnValue().Set(Nan::New(ignored == 1)); else - NanReturnValue(NanNew(false)); + return info.GetReturnValue().Set(Nan::New(false)); } NAN_METHOD(Repository::IsSubmodule) { - NanScope(); - if (args.Length() < 1) - NanReturnValue(NanNew(false)); + Nan::HandleScope scope; + if (info.Length() < 1) + return info.GetReturnValue().Set(Nan::New(false)); git_index* index; - git_repository* repository = GetRepository(args); + git_repository* repository = GetRepository(info); if (git_repository_index(&index, repository) == GIT_OK) { - std::string path(*String::Utf8Value(args[0])); + std::string path(*String::Utf8Value(info[0])); const git_index_entry* entry = git_index_get_bypath(index, path.c_str(), 0); - Handle isSubmodule = NanNew( + Local isSubmodule = Nan::New( entry != NULL && (entry->mode & S_IFMT) == GIT_FILEMODE_COMMIT); git_index_free(index); - NanReturnValue(isSubmodule); + return info.GetReturnValue().Set(isSubmodule); } else { - NanReturnValue(NanNew(false)); + return info.GetReturnValue().Set(Nan::New(false)); } } NAN_METHOD(Repository::GetConfigValue) { - NanScope(); - if (args.Length() < 1) - NanReturnNull(); + Nan::HandleScope scope; + if (info.Length() < 1) + return info.GetReturnValue().Set(Nan::Null()); git_config* config; - git_repository* repository = GetRepository(args); + git_repository* repository = GetRepository(info); if (git_repository_config(&config, repository) != GIT_OK) - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); - std::string configKey(*String::Utf8Value(args[0])); + std::string configKey(*String::Utf8Value(info[0])); const char* configValue; if (git_config_get_string( &configValue, config, configKey.c_str()) == GIT_OK) { - Handle configValueHandle = NanNew(configValue); git_config_free(config); - NanReturnValue(configValueHandle); + return info.GetReturnValue().Set(Nan::New(configValue) + .ToLocalChecked()); } else { git_config_free(config); - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); } } NAN_METHOD(Repository::SetConfigValue) { - NanScope(); - if (args.Length() != 2) - NanReturnValue(NanNew(false)); + Nan::HandleScope scope; + if (info.Length() != 2) + return info.GetReturnValue().Set(Nan::New(false)); git_config* config; - git_repository* repository = GetRepository(args); + git_repository* repository = GetRepository(info); if (git_repository_config(&config, repository) != GIT_OK) - NanReturnValue(NanNew(false)); + return info.GetReturnValue().Set(Nan::New(false)); - std::string configKey(*String::Utf8Value(args[0])); - std::string configValue(*String::Utf8Value(args[1])); + std::string configKey(*String::Utf8Value(info[0])); + std::string configValue(*String::Utf8Value(info[1])); int errorCode = git_config_set_string( config, configKey.c_str(), configValue.c_str()); git_config_free(config); - NanReturnValue(NanNew(errorCode == GIT_OK)); + return info.GetReturnValue().Set(Nan::New(errorCode == GIT_OK)); } NAN_METHOD(Repository::GetStatus) { - NanScope(); - if (args.Length() < 1) { - Local result = NanNew(); + Nan::HandleScope scope; + if (info.Length() < 1) { + Local result = Nan::New(); std::map statuses; git_status_options options = GIT_STATUS_OPTIONS_INIT; options.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS; - if (git_status_foreach_ext(GetRepository(args), + if (git_status_foreach_ext(GetRepository(info), &options, StatusCallback, &statuses) == GIT_OK) { std::map::iterator iter = statuses.begin(); for (; iter != statuses.end(); ++iter) - result->Set(NanNew(iter->first.c_str()), - NanNew(iter->second)); + result->Set(Nan::New(iter->first.c_str()).ToLocalChecked(), + Nan::New(iter->second)); } - NanReturnValue(result); + return info.GetReturnValue().Set(result); } else { - git_repository* repository = GetRepository(args); - std::string path(*String::Utf8Value(args[0])); + git_repository* repository = GetRepository(info); + std::string path(*String::Utf8Value(info[0])); unsigned int status = 0; if (git_status_file(&status, repository, path.c_str()) == GIT_OK) - NanReturnValue(NanNew(status)); + return info.GetReturnValue().Set(Nan::New(status)); else - NanReturnValue(NanNew(0)); + return info.GetReturnValue().Set(Nan::New(0)); } } NAN_METHOD(Repository::CheckoutHead) { - NanScope(); - if (args.Length() < 1) - NanReturnValue(NanNew(false)); + Nan::HandleScope scope; + if (info.Length() < 1) + return info.GetReturnValue().Set(Nan::New(false)); - String::Utf8Value utf8Path(args[0]); + String::Utf8Value utf8Path(info[0]); char* path = *utf8Path; git_checkout_options options = GIT_CHECKOUT_OPTIONS_INIT; @@ -337,58 +342,61 @@ NAN_METHOD(Repository::CheckoutHead) { paths.strings = &path; options.paths = paths; - int result = git_checkout_head(GetRepository(args), &options); - NanReturnValue(NanNew(result == GIT_OK)); + int result = git_checkout_head(GetRepository(info), &options); + return info.GetReturnValue().Set(Nan::New(result == GIT_OK)); } NAN_METHOD(Repository::GetReferenceTarget) { - NanScope(); - if (args.Length() < 1) - NanReturnNull(); + Nan::HandleScope scope; + if (info.Length() < 1) + return info.GetReturnValue().Set(Nan::Null()); - std::string refName(*String::Utf8Value(args[0])); + std::string refName(*String::Utf8Value(info[0])); git_oid sha; if (git_reference_name_to_id( - &sha, GetRepository(args), refName.c_str()) == GIT_OK) { + &sha, GetRepository(info), refName.c_str()) == GIT_OK) { char oid[GIT_OID_HEXSZ + 1]; git_oid_tostr(oid, GIT_OID_HEXSZ + 1, &sha); - NanReturnValue(NanNew(oid, -1)); + return info.GetReturnValue().Set(Nan::New(oid, -1) + .ToLocalChecked()); } else { - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); } } NAN_METHOD(Repository::GetDiffStats) { - NanScope(); + Nan::HandleScope scope; int added = 0; int deleted = 0; - Local result = NanNew(); - result->Set(NanNew("added"), NanNew(added)); - result->Set(NanNew("deleted"), NanNew(deleted)); + Local result = Nan::New(); + result->Set(Nan::New("added").ToLocalChecked(), + Nan::New(added)); + result->Set(Nan::New("deleted").ToLocalChecked(), + Nan::New(deleted)); - if (args.Length() < 1) - NanReturnValue(result); + if (info.Length() < 1) + return info.GetReturnValue().Set(result); - git_repository* repository = GetRepository(args); + git_repository* repository = GetRepository(info); git_reference* head; if (git_repository_head(&head, repository) != GIT_OK) - NanReturnValue(result); + return info.GetReturnValue().Set(result); const git_oid* sha = git_reference_target(head); git_commit* commit; int commitStatus = git_commit_lookup(&commit, repository, sha); git_reference_free(head); if (commitStatus != GIT_OK) - NanReturnValue(result); + return info.GetReturnValue().Set(result); git_tree* tree; int treeStatus = git_commit_tree(&tree, commit); git_commit_free(commit); if (treeStatus != GIT_OK) - NanReturnValue(result); + return info.GetReturnValue().Set(result); - String::Utf8Value utf8Path(args[0]); + String::Utf8Value utf8Path(info[0]); char* path = *utf8Path; git_diff_options options = CreateDefaultGitDiffOptions(); @@ -403,19 +411,19 @@ NAN_METHOD(Repository::GetDiffStats) { int diffStatus = git_diff_tree_to_workdir(&diffs, repository, tree, &options); git_tree_free(tree); if (diffStatus != GIT_OK) - NanReturnValue(result); + return info.GetReturnValue().Set(result); int deltas = git_diff_num_deltas(diffs); if (deltas != 1) { git_diff_free(diffs); - NanReturnValue(result); + return info.GetReturnValue().Set(result); } git_patch* patch; int patchStatus = git_patch_from_diff(&patch, diffs, 0); git_diff_free(diffs); if (patchStatus != GIT_OK) - NanReturnValue(result); + return info.GetReturnValue().Set(result); int hunks = git_patch_num_hunks(patch); for (int i = 0; i < hunks; i++) { @@ -436,40 +444,43 @@ NAN_METHOD(Repository::GetDiffStats) { } git_patch_free(patch); - result->Set(NanNew("added"), NanNew(added)); - result->Set(NanNew("deleted"), NanNew(deleted)); - NanReturnValue(result); + result->Set(Nan::New("added").ToLocalChecked(), + Nan::New(added)); + result->Set(Nan::New("deleted").ToLocalChecked(), + Nan::New(deleted)); + + return info.GetReturnValue().Set(result); } NAN_METHOD(Repository::GetHeadBlob) { - NanScope(); - if (args.Length() < 1) - NanReturnNull(); + Nan::HandleScope scope; + if (info.Length() < 1) + return info.GetReturnValue().Set(Nan::Null()); - std::string path(*String::Utf8Value(args[0])); + std::string path(*String::Utf8Value(info[0])); - git_repository* repo = GetRepository(args); + git_repository* repo = GetRepository(info); git_reference* head; if (git_repository_head(&head, repo) != GIT_OK) - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); const git_oid* sha = git_reference_target(head); git_commit* commit; int commitStatus = git_commit_lookup(&commit, repo, sha); git_reference_free(head); if (commitStatus != GIT_OK) - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); git_tree* tree; int treeStatus = git_commit_tree(&tree, commit); git_commit_free(commit); if (treeStatus != GIT_OK) - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); git_tree_entry* treeEntry; if (git_tree_entry_bypath(&treeEntry, tree, path.c_str()) != GIT_OK) { git_tree_free(tree); - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); } git_blob* blob = NULL; @@ -479,31 +490,31 @@ NAN_METHOD(Repository::GetHeadBlob) { git_tree_entry_free(treeEntry); git_tree_free(tree); if (blob == NULL) - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); const char* content = static_cast(git_blob_rawcontent(blob)); - Handle value = NanNew(content); + Local value = Nan::New(content).ToLocalChecked(); git_blob_free(blob); - NanReturnValue(value); + return info.GetReturnValue().Set(value); } NAN_METHOD(Repository::GetIndexBlob) { - NanScope(); - if (args.Length() < 1) - NanReturnNull(); + Nan::HandleScope scope; + if (info.Length() < 1) + return info.GetReturnValue().Set(Nan::Null()); - std::string path(*String::Utf8Value(args[0])); + std::string path(*String::Utf8Value(info[0])); - git_repository* repo = GetRepository(args); + git_repository* repo = GetRepository(info); git_index* index; if (git_repository_index(&index, repo) != GIT_OK) - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); git_index_read(index, 0); const git_index_entry* entry = git_index_get_bypath(index, path.data(), 0); if (entry == NULL) { git_index_free(index); - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); } git_blob* blob = NULL; @@ -512,12 +523,12 @@ NAN_METHOD(Repository::GetIndexBlob) { blob = NULL; git_index_free(index); if (blob == NULL) - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); const char* content = static_cast(git_blob_rawcontent(blob)); - Handle value = NanNew(content); + Local value = Nan::New(content).ToLocalChecked(); git_blob_free(blob); - NanReturnValue(value); + return info.GetReturnValue().Set(value); } int Repository::StatusCallback( @@ -539,33 +550,33 @@ int Repository::SubmoduleCallback( } NAN_METHOD(Repository::Release) { - NanScope(); - Repository* repo = node::ObjectWrap::Unwrap(args.This()); + Nan::HandleScope scope; + Repository* repo = Nan::ObjectWrap::Unwrap(info.This()); if (repo->repository != NULL) { git_repository_free(repo->repository); repo->repository = NULL; } - NanReturnUndefined(); + info.GetReturnValue().SetUndefined(); } NAN_METHOD(Repository::GetCommitCount) { - NanScope(); - if (args.Length() < 2) - NanReturnValue(NanNew(0)); + Nan::HandleScope scope; + if (info.Length() < 2) + return info.GetReturnValue().Set(Nan::New(0)); - std::string fromCommitId(*String::Utf8Value(args[0])); + std::string fromCommitId(*String::Utf8Value(info[0])); git_oid fromCommit; if (git_oid_fromstr(&fromCommit, fromCommitId.c_str()) != GIT_OK) - NanReturnValue(NanNew(0)); + return info.GetReturnValue().Set(Nan::New(0)); - std::string toCommitId(*String::Utf8Value(args[1])); + std::string toCommitId(*String::Utf8Value(info[1])); git_oid toCommit; if (git_oid_fromstr(&toCommit, toCommitId.c_str()) != GIT_OK) - NanReturnValue(NanNew(0)); + return info.GetReturnValue().Set(Nan::New(0)); git_revwalk* revWalk; - if (git_revwalk_new(&revWalk, GetRepository(args)) != GIT_OK) - NanReturnValue(NanNew(0)); + if (git_revwalk_new(&revWalk, GetRepository(info)) != GIT_OK) + return info.GetReturnValue().Set(Nan::New(0)); git_revwalk_push(revWalk, &fromCommit); git_revwalk_hide(revWalk, &toCommit); @@ -574,33 +585,34 @@ NAN_METHOD(Repository::GetCommitCount) { while (git_revwalk_next(¤tCommit, revWalk) == GIT_OK) count++; git_revwalk_free(revWalk); - NanReturnValue(NanNew(count)); + return info.GetReturnValue().Set(Nan::New(count)); } NAN_METHOD(Repository::GetMergeBase) { - NanScope(); - if (args.Length() < 2) - NanReturnNull(); + Nan::HandleScope scope; + if (info.Length() < 2) + return info.GetReturnValue().Set(Nan::Null()); - std::string commitOneId(*String::Utf8Value(args[0])); + std::string commitOneId(*String::Utf8Value(info[0])); git_oid commitOne; if (git_oid_fromstr(&commitOne, commitOneId.c_str()) != GIT_OK) - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); - std::string commitTwoId(*String::Utf8Value(args[1])); + std::string commitTwoId(*String::Utf8Value(info[1])); git_oid commitTwo; if (git_oid_fromstr(&commitTwo, commitTwoId.c_str()) != GIT_OK) - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); git_oid mergeBase; if (git_merge_base( - &mergeBase, GetRepository(args), &commitOne, &commitTwo) == GIT_OK) { + &mergeBase, GetRepository(info), &commitOne, &commitTwo) == GIT_OK) { char mergeBaseId[GIT_OID_HEXSZ + 1]; git_oid_tostr(mergeBaseId, GIT_OID_HEXSZ + 1, &mergeBase); - NanReturnValue(NanNew(mergeBaseId, -1)); + return info.GetReturnValue().Set(Nan::New(mergeBaseId, -1) + .ToLocalChecked()); } - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); } int Repository::DiffHunkCallback(const git_diff_delta* delta, @@ -613,28 +625,32 @@ int Repository::DiffHunkCallback(const git_diff_delta* delta, } NAN_METHOD(Repository::GetLineDiffs) { - NanScope(); - if (args.Length() < 2) - NanReturnNull(); + Nan::HandleScope scope; + if (info.Length() < 2) + return info.GetReturnValue().Set(Nan::Null()); - std::string text(*String::Utf8Value(args[1])); + std::string text(*String::Utf8Value(info[1])); - git_repository* repo = GetRepository(args); + git_repository* repo = GetRepository(info); git_blob* blob = NULL; - int getBlobResult = GetBlob(args, repo, blob); + int getBlobResult = GetBlob(info, repo, blob); if (getBlobResult != 0) - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); std::vector ranges; git_diff_options options = CreateDefaultGitDiffOptions(); // Set GIT_DIFF_IGNORE_WHITESPACE_EOL when ignoreEolWhitespace: true - if (args.Length() >= 3) { - Local optionsArg(Local::Cast(args[2])); - if (optionsArg->Get(NanNew("ignoreEolWhitespace"))->BooleanValue()) + if (info.Length() >= 3) { + Local optionsArg(Local::Cast(info[2])); + Local ignoreEolWhitespace; + ignoreEolWhitespace = optionsArg->Get( + Nan::New("ignoreEolWhitespace").ToLocalChecked()); + + if (ignoreEolWhitespace->BooleanValue()) options.flags = GIT_DIFF_IGNORE_WHITESPACE_EOL; } @@ -642,24 +658,24 @@ NAN_METHOD(Repository::GetLineDiffs) { if (git_diff_blob_to_buffer(blob, NULL, text.data(), text.length(), NULL, &options, NULL, DiffHunkCallback, NULL, &ranges) == GIT_OK) { - Local v8Ranges = NanNew(ranges.size()); + Local v8Ranges = Nan::New(ranges.size()); for (size_t i = 0; i < ranges.size(); i++) { - Local v8Range = NanNew(); - v8Range->Set(NanNew("oldStart"), - NanNew(ranges[i].old_start)); - v8Range->Set(NanNew("oldLines"), - NanNew(ranges[i].old_lines)); - v8Range->Set(NanNew("newStart"), - NanNew(ranges[i].new_start)); - v8Range->Set(NanNew("newLines"), - NanNew(ranges[i].new_lines)); + Local v8Range = Nan::New(); + v8Range->Set(Nan::New("oldStart").ToLocalChecked(), + Nan::New(ranges[i].old_start)); + v8Range->Set(Nan::New("oldLines").ToLocalChecked(), + Nan::New(ranges[i].old_lines)); + v8Range->Set(Nan::New("newStart").ToLocalChecked(), + Nan::New(ranges[i].new_start)); + v8Range->Set(Nan::New("newLines").ToLocalChecked(), + Nan::New(ranges[i].new_lines)); v8Ranges->Set(i, v8Range); } git_blob_free(blob); - NanReturnValue(v8Ranges); + return info.GetReturnValue().Set(v8Ranges); } else { git_blob_free(blob); - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); } } @@ -682,28 +698,32 @@ int Repository::DiffLineCallback(const git_diff_delta* delta, } NAN_METHOD(Repository::GetLineDiffDetails) { - NanScope(); - if (args.Length() < 2) - NanReturnNull(); + Nan::HandleScope scope; + if (info.Length() < 2) + return info.GetReturnValue().Set(Nan::Null()); - std::string text(*String::Utf8Value(args[1])); + std::string text(*String::Utf8Value(info[1])); - git_repository* repo = GetRepository(args); + git_repository* repo = GetRepository(info); git_blob* blob = NULL; - int getBlobResult = GetBlob(args, repo, blob); + int getBlobResult = GetBlob(info, repo, blob); if (getBlobResult != 0) - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); std::vector lineDiffs; git_diff_options options = CreateDefaultGitDiffOptions(); // Set GIT_DIFF_IGNORE_WHITESPACE_EOL when ignoreEolWhitespace: true - if (args.Length() >= 3) { - Local optionsArg(Local::Cast(args[2])); - if (optionsArg->Get(NanNew("ignoreEolWhitespace"))->BooleanValue()) + if (info.Length() >= 3) { + Local optionsArg(Local::Cast(info[2])); + Local ignoreEolWhitespace; + ignoreEolWhitespace = optionsArg->Get( + Nan::New("ignoreEolWhitespace").ToLocalChecked()); + + if (ignoreEolWhitespace->BooleanValue()) options.flags = GIT_DIFF_IGNORE_WHITESPACE_EOL; } @@ -711,54 +731,55 @@ NAN_METHOD(Repository::GetLineDiffDetails) { if (git_diff_blob_to_buffer(blob, NULL, text.data(), text.length(), NULL, &options, NULL, NULL, DiffLineCallback, &lineDiffs) == GIT_OK) { - Local v8Ranges = NanNew(lineDiffs.size()); + Local v8Ranges = Nan::New(lineDiffs.size()); for (size_t i = 0; i < lineDiffs.size(); i++) { - Local v8Range = NanNew(); - - v8Range->Set(NanNew("oldLineNumber"), - NanNew(lineDiffs[i].line.old_lineno)); - v8Range->Set(NanNew("newLineNumber"), - NanNew(lineDiffs[i].line.new_lineno)); - v8Range->Set(NanNew("oldStart"), - NanNew(lineDiffs[i].hunk.old_start)); - v8Range->Set(NanNew("newStart"), - NanNew(lineDiffs[i].hunk.new_start)); - v8Range->Set(NanNew("oldLines"), - NanNew(lineDiffs[i].hunk.old_lines)); - v8Range->Set(NanNew("newLines"), - NanNew(lineDiffs[i].hunk.new_lines)); - v8Range->Set(NanNew("line"), - NanNew(lineDiffs[i].line.content, - lineDiffs[i].line.content_len)); + Local v8Range = Nan::New(); + + v8Range->Set(Nan::New("oldLineNumber").ToLocalChecked(), + Nan::New(lineDiffs[i].line.old_lineno)); + v8Range->Set(Nan::New("newLineNumber").ToLocalChecked(), + Nan::New(lineDiffs[i].line.new_lineno)); + v8Range->Set(Nan::New("oldStart").ToLocalChecked(), + Nan::New(lineDiffs[i].hunk.old_start)); + v8Range->Set(Nan::New("newStart").ToLocalChecked(), + Nan::New(lineDiffs[i].hunk.new_start)); + v8Range->Set(Nan::New("oldLines").ToLocalChecked(), + Nan::New(lineDiffs[i].hunk.old_lines)); + v8Range->Set(Nan::New("newLines").ToLocalChecked(), + Nan::New(lineDiffs[i].hunk.new_lines)); + v8Range->Set(Nan::New("line").ToLocalChecked(), + Nan::New(lineDiffs[i].line.content, + lineDiffs[i].line.content_len) + .ToLocalChecked()); v8Ranges->Set(i, v8Range); } git_blob_free(blob); - NanReturnValue(v8Ranges); + return info.GetReturnValue().Set(v8Ranges); } else { git_blob_free(blob); - NanReturnNull(); + return info.GetReturnValue().Set(Nan::Null()); } } -Handle Repository::ConvertStringVectorToV8Array( +Local Repository::ConvertStringVectorToV8Array( const std::vector& vector) { size_t i = 0, size = vector.size(); - Local array = NanNew(size); + Local array = Nan::New(size); for (i = 0; i < size; i++) - array->Set(i, NanNew(vector[i].c_str())); + array->Set(i, Nan::New(vector[i].c_str()).ToLocalChecked()); return array; } NAN_METHOD(Repository::GetReferences) { - NanScope(); + Nan::HandleScope scope; - Local references = NanNew(); + Local references = Nan::New(); std::vector heads, remotes, tags; git_strarray strarray; - git_reference_list(&strarray, GetRepository(args)); + git_reference_list(&strarray, GetRepository(info)); for (unsigned int i = 0; i < strarray.count; i++) if (strncmp(strarray.strings[i], "refs/heads/", 11) == 0) @@ -770,12 +791,14 @@ NAN_METHOD(Repository::GetReferences) { git_strarray_free(&strarray); - references->Set(NanNew("heads"), ConvertStringVectorToV8Array(heads)); - references->Set(NanNew("remotes"), - ConvertStringVectorToV8Array(remotes)); - references->Set(NanNew("tags"), ConvertStringVectorToV8Array(tags)); + references->Set(Nan::New("heads").ToLocalChecked(), + ConvertStringVectorToV8Array(heads)); + references->Set(Nan::New("remotes").ToLocalChecked(), + ConvertStringVectorToV8Array(remotes)); + references->Set(Nan::New("tags").ToLocalChecked(), + ConvertStringVectorToV8Array(tags)); - NanReturnValue(references); + info.GetReturnValue().Set(references); } int branch_checkout(git_repository* repo, const char* refName) { @@ -799,28 +822,28 @@ int branch_checkout(git_repository* repo, const char* refName) { } NAN_METHOD(Repository::CheckoutReference) { - NanScope(); + Nan::HandleScope scope; - if (args.Length() < 1) - NanReturnValue(NanNew(false)); + if (info.Length() < 1) + return info.GetReturnValue().Set(Nan::New(false)); bool shouldCreateNewRef; - if (args.Length() > 1 && args[1]->BooleanValue()) + if (info.Length() > 1 && info[1]->BooleanValue()) shouldCreateNewRef = true; else shouldCreateNewRef = false; - std::string strRefName(*String::Utf8Value(args[0])); + std::string strRefName(*String::Utf8Value(info[0])); const char* refName = strRefName.c_str(); - git_repository* repo = GetRepository(args); + git_repository* repo = GetRepository(info); if (branch_checkout(repo, refName) == GIT_OK) { - NanReturnValue(NanNew(true)); + return info.GetReturnValue().Set(Nan::New(true)); } else if (shouldCreateNewRef) { git_reference* head; if (git_repository_head(&head, repo) != GIT_OK) - NanReturnValue(NanNew(false)); + return info.GetReturnValue().Set(Nan::New(false)); const git_oid* sha = git_reference_target(head); git_commit* commit; @@ -828,7 +851,7 @@ NAN_METHOD(Repository::CheckoutReference) { git_reference_free(head); if (commitStatus != GIT_OK) - NanReturnValue(NanNew(false)); + return info.GetReturnValue().Set(Nan::New(false)); git_reference* branch; // N.B.: git_branch_create needs a name like 'xxx', not 'refs/heads/xxx' @@ -840,55 +863,55 @@ NAN_METHOD(Repository::CheckoutReference) { git_commit_free(commit); if (branchCreateStatus != GIT_OK) - NanReturnValue(NanNew(false)); + return info.GetReturnValue().Set(Nan::New(false)); git_reference_free(branch); if (branch_checkout(repo, refName) == GIT_OK) - NanReturnValue(NanNew(true)); + return info.GetReturnValue().Set(Nan::New(true)); } - NanReturnValue(NanNew(false)); + return info.GetReturnValue().Set(Nan::New(false)); } NAN_METHOD(Repository::Add) { - NanScope(); + Nan::HandleScope scope; - git_repository* repository = GetRepository(args); - std::string path(*String::Utf8Value(args[0])); + git_repository* repository = GetRepository(info); + std::string path(*String::Utf8Value(info[0])); git_index* index; if (git_repository_index(&index, repository) != GIT_OK) { const git_error* e = giterr_last(); if (e != NULL) - return NanThrowError(e->message); + return Nan::ThrowError(e->message); else - return NanThrowError("Unknown error opening index"); + return Nan::ThrowError("Unknown error opening index"); } // Modify the in-memory index. if (git_index_add_bypath(index, path.c_str()) != GIT_OK) { git_index_free(index); const git_error* e = giterr_last(); if (e != NULL) - return NanThrowError(e->message); + return Nan::ThrowError(e->message); else - return NanThrowError("Unknown error adding path to index"); + return Nan::ThrowError("Unknown error adding path to index"); } // Write this change in the index back to disk, so it is persistent if (git_index_write(index) != GIT_OK) { git_index_free(index); const git_error* e = giterr_last(); if (e != NULL) - return NanThrowError(e->message); + return Nan::ThrowError(e->message); else - return NanThrowError("Unknown error adding path to index"); + return Nan::ThrowError("Unknown error adding path to index"); } git_index_free(index); - NanReturnValue(NanNew(true)); + info.GetReturnValue().Set(Nan::New(true)); } -Repository::Repository(Handle path) { - NanScope(); +Repository::Repository(Local path) { + Nan::HandleScope scope; std::string repositoryPath(*String::Utf8Value(path)); if (git_repository_open_ext( diff --git a/src/repository.h b/src/repository.h index 9e913795..9f78f36b 100644 --- a/src/repository.h +++ b/src/repository.h @@ -29,9 +29,9 @@ #include "nan.h" using namespace v8; // NOLINT -class Repository : public node::ObjectWrap { +class Repository : public Nan::ObjectWrap { public: - static void Init(Handle target); + static void Init(Local target); private: static NAN_METHOD(New); @@ -72,17 +72,17 @@ class Repository : public node::ObjectWrap { static int SubmoduleCallback(git_submodule *submodule, const char *name, void *payload); - static Handle ConvertStringVectorToV8Array( + static Local ConvertStringVectorToV8Array( const std::vector& vector); - static git_repository* GetRepository(_NAN_METHOD_ARGS_TYPE args); + static git_repository* GetRepository(Nan::NAN_METHOD_ARGS_TYPE args); - static int GetBlob(_NAN_METHOD_ARGS_TYPE args, + static int GetBlob(Nan::NAN_METHOD_ARGS_TYPE args, git_repository* repo, git_blob*& blob); static git_diff_options CreateDefaultGitDiffOptions(); - explicit Repository(Handle path); + explicit Repository(Local path); ~Repository(); git_repository* repository; From ffb692a0f2e7ad3b5ea9d40f97b43dfeacc31577 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 11 Sep 2015 17:15:22 +0800 Subject: [PATCH 077/194] 4.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 887a33ef..de880453 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "3.0.1", + "version": "4.0.0", "licenses": [ { "type": "MIT", From 478f42f5ef0ca1579a19bf30fb59a8cfc772b593 Mon Sep 17 00:00:00 2001 From: Gabriel Isenberg Date: Mon, 14 Sep 2015 12:34:44 -0700 Subject: [PATCH 078/194] Updated Travis build settings to build against node 4 --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index fd26d031..486c3726 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ notifications: node_js: - "0.10" + - "4.0" git: depth: 10 @@ -14,3 +15,8 @@ git: branches: only: - master + +sudo: false + +env: + - CC=clang CXX=clang++ npm_config_clang=1 From 3ba104e7a4ddf91728c0ecac15f552f4a230cb72 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 12:41:20 +0800 Subject: [PATCH 079/194] Set win_delay_load_hook to false --- binding.gyp | 1 + 1 file changed, 1 insertion(+) diff --git a/binding.gyp b/binding.gyp index a4493610..7ca47f10 100644 --- a/binding.gyp +++ b/binding.gyp @@ -2,6 +2,7 @@ 'targets': [ { 'target_name': 'git', + 'win_delay_load_hook': 'false', 'dependencies': [ 'libgit2' ], From 1a04cd5805868eb2bce36d2f6d1eebc42fae8d82 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 12:41:31 +0800 Subject: [PATCH 080/194] 4.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index de880453..21f3b62a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.0.0", + "version": "4.0.1", "licenses": [ { "type": "MIT", From c1618cf81cdaa1f5e9011c882498b7d9bde9ee47 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 12:47:46 +0800 Subject: [PATCH 081/194] Set win_delay_load_hook for all targets --- binding.gyp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/binding.gyp b/binding.gyp index 7ca47f10..bb97c8a4 100644 --- a/binding.gyp +++ b/binding.gyp @@ -33,6 +33,7 @@ }, { 'target_name': 'libgit2', + 'win_delay_load_hook': 'false', 'type': 'static_library', 'defines': [ 'GIT_THREADS', @@ -364,6 +365,7 @@ }, { 'target_name': 'zlib', + 'win_delay_load_hook': 'false', 'type': 'static_library', 'sources': [ 'deps/libgit2/deps/zlib/adler32.c', @@ -409,6 +411,7 @@ }, { 'target_name': 'http_parser', + 'win_delay_load_hook': 'false', 'type': 'static_library', 'sources': [ 'deps/libgit2/deps/http-parser/http_parser.c', From 07de5ad59ceab6c58a52074aa809fd117d774ba2 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 12:48:02 +0800 Subject: [PATCH 082/194] 4.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 21f3b62a..cf262772 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.0.1", + "version": "4.0.2", "licenses": [ { "type": "MIT", From f45ccc2a01e4d4b1f093f9f3983744b628034da0 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 12:54:10 +0800 Subject: [PATCH 083/194] Add missing files in win32 --- binding.gyp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index bb97c8a4..64a9b753 100644 --- a/binding.gyp +++ b/binding.gyp @@ -63,7 +63,6 @@ 'deps/libgit2/src/blob.h', 'deps/libgit2/src/branch.c', 'deps/libgit2/src/branch.h', - 'deps/libgit2/src/bswap.h', 'deps/libgit2/src/buf_text.c', 'deps/libgit2/src/buf_text.h', 'deps/libgit2/src/buffer.c', @@ -124,7 +123,6 @@ 'deps/libgit2/src/hash.c', 'deps/libgit2/src/hash.h', 'deps/libgit2/src/hashsig.c', - 'deps/libgit2/src/hashsig.h', 'deps/libgit2/src/ident.c', 'deps/libgit2/src/ignore.c', 'deps/libgit2/src/ignore.h', @@ -315,6 +313,8 @@ 'deps/libgit2/src/win32/map.c', 'deps/libgit2/src/win32/mingw-compat.h', 'deps/libgit2/src/win32/msvc-compat.h', + 'deps/libgit2/src/win32/path_w32.c', + 'deps/libgit2/src/win32/path_w32.h', 'deps/libgit2/src/win32/posix.h', 'deps/libgit2/src/win32/posix_w32.c', 'deps/libgit2/src/win32/precompiled.c', @@ -325,6 +325,12 @@ 'deps/libgit2/src/win32/utf-conv.c', 'deps/libgit2/src/win32/utf-conv.h', 'deps/libgit2/src/win32/version.h', + 'deps/libgit2/src/win32/w32_buffer.c', + 'deps/libgit2/src/win32/w32_buffer.h', + 'deps/libgit2/src/win32/w32_crtdbg_stacktrace.c', + 'deps/libgit2/src/win32/w32_crtdbg_stacktrace.h', + 'deps/libgit2/src/win32/w32_stack.c', + 'deps/libgit2/src/win32/w32_stack.h', 'deps/libgit2/src/win32/w32_util.c', 'deps/libgit2/src/win32/w32_util.h', 'deps/libgit2/deps/regex/regex.c', From 255f995d88a20a95272bb2d4fd54448a2ce6e61d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 12:54:26 +0800 Subject: [PATCH 084/194] 4.0.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cf262772..53cb55f4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.0.2", + "version": "4.0.3", "licenses": [ { "type": "MIT", From 766b78694d12f0e3293c6b7e15c7f0192a12aeb6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 13:06:12 +0800 Subject: [PATCH 085/194] Add a few more missing files --- binding.gyp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/binding.gyp b/binding.gyp index 64a9b753..49a69b23 100644 --- a/binding.gyp +++ b/binding.gyp @@ -46,19 +46,20 @@ 'http_parser', ], 'sources': [ + 'deps/libgit2/src/annotated_commit.c', + 'deps/libgit2/src/annotated_commit.h', 'deps/libgit2/src/array.h', 'deps/libgit2/src/attr.c', 'deps/libgit2/src/attr.h', 'deps/libgit2/src/attr_file.c', 'deps/libgit2/src/attr_file.h', - 'deps/libgit2/src/bitvec.h', 'deps/libgit2/src/attrcache.c', 'deps/libgit2/src/attrcache.h', 'deps/libgit2/src/bitvec.h', - 'deps/libgit2/src/blame_git.c', - 'deps/libgit2/src/blame_git.h', 'deps/libgit2/src/blame.c', 'deps/libgit2/src/blame.h', + 'deps/libgit2/src/blame_git.c', + 'deps/libgit2/src/blame_git.h', 'deps/libgit2/src/blob.c', 'deps/libgit2/src/blob.h', 'deps/libgit2/src/branch.c', @@ -86,11 +87,14 @@ 'deps/libgit2/src/config_file.c', 'deps/libgit2/src/config_file.h', 'deps/libgit2/src/crlf.c', + 'deps/libgit2/src/curl_stream.c', + 'deps/libgit2/src/curl_stream.h', 'deps/libgit2/src/date.c', 'deps/libgit2/src/delta-apply.c', 'deps/libgit2/src/delta-apply.h', 'deps/libgit2/src/delta.c', 'deps/libgit2/src/delta.h', + 'deps/libgit2/src/describe.c', 'deps/libgit2/src/diff.c', 'deps/libgit2/src/diff.h', 'deps/libgit2/src/diff_driver.c', @@ -129,6 +133,7 @@ 'deps/libgit2/src/index.c', 'deps/libgit2/src/index.h', 'deps/libgit2/src/indexer.c', + 'deps/libgit2/src/integer.h', 'deps/libgit2/src/iterator.c', 'deps/libgit2/src/iterator.h', 'deps/libgit2/src/khash.h', @@ -156,7 +161,11 @@ 'deps/libgit2/src/offmap.h', 'deps/libgit2/src/oid.c', 'deps/libgit2/src/oid.h', + 'deps/libgit2/src/oidarray.c', + 'deps/libgit2/src/oidarray.h', 'deps/libgit2/src/oidmap.h', + 'deps/libgit2/src/openssl_stream.c', + 'deps/libgit2/src/openssl_stream.h', 'deps/libgit2/src/pack-objects.c', 'deps/libgit2/src/pack-objects.h', 'deps/libgit2/src/pack.c', @@ -173,6 +182,7 @@ 'deps/libgit2/src/pqueue.h', 'deps/libgit2/src/push.c', 'deps/libgit2/src/push.h', + 'deps/libgit2/src/rebase.c', 'deps/libgit2/src/refdb.c', 'deps/libgit2/src/refdb.h', 'deps/libgit2/src/refdb_fs.c', @@ -198,11 +208,16 @@ 'deps/libgit2/src/sha1_lookup.h', 'deps/libgit2/src/signature.c', 'deps/libgit2/src/signature.h', + 'deps/libgit2/src/socket_stream.c', + 'deps/libgit2/src/socket_stream.h', 'deps/libgit2/src/sortedcache.c', 'deps/libgit2/src/sortedcache.h', 'deps/libgit2/src/stash.c', 'deps/libgit2/src/status.c', 'deps/libgit2/src/status.h', + 'deps/libgit2/src/stransport_stream.c', + 'deps/libgit2/src/stransport_stream.h', + 'deps/libgit2/src/stream.h', 'deps/libgit2/src/strmap.c', 'deps/libgit2/src/strmap.h', 'deps/libgit2/src/strnlen.h', @@ -214,14 +229,19 @@ 'deps/libgit2/src/tag.h', 'deps/libgit2/src/thread-utils.c', 'deps/libgit2/src/thread-utils.h', + 'deps/libgit2/src/tls_stream.c', + 'deps/libgit2/src/tls_stream.h', 'deps/libgit2/src/trace.c', 'deps/libgit2/src/trace.h', + 'deps/libgit2/src/transaction.c', + 'deps/libgit2/src/transaction.h', 'deps/libgit2/src/transport.c', 'deps/libgit2/src/tree-cache.c', 'deps/libgit2/src/tree-cache.h', 'deps/libgit2/src/tree.c', 'deps/libgit2/src/tree.h', 'deps/libgit2/src/tsort.c', + 'deps/libgit2/src/userdiff.h', 'deps/libgit2/src/util.c', 'deps/libgit2/src/util.h', 'deps/libgit2/src/vector.c', From 805a81e9fad89ca83cab521726d326be0dfbbb55 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 13:08:00 +0800 Subject: [PATCH 086/194] Link with winhttp.lib --- binding.gyp | 1 + 1 file changed, 1 insertion(+) diff --git a/binding.gyp b/binding.gyp index 49a69b23..11b3afa4 100644 --- a/binding.gyp +++ b/binding.gyp @@ -293,6 +293,7 @@ 'msvs_settings': { 'VCLinkerTool': { 'AdditionalDependencies': [ + 'winhttp.lib', 'ws2_32.lib', ], }, From 6e97306afc94edae2f843e44fed672a74306b810 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 13:08:26 +0800 Subject: [PATCH 087/194] v4.0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 53cb55f4..756ff717 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.0.3", + "version": "4.0.4", "licenses": [ { "type": "MIT", From e1a4923dde6c4dddca22c657a3c6bf75b41c98b5 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 13:16:08 +0800 Subject: [PATCH 088/194] Link with a few more libraries --- binding.gyp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/binding.gyp b/binding.gyp index 11b3afa4..3eccd5b1 100644 --- a/binding.gyp +++ b/binding.gyp @@ -290,13 +290,15 @@ 'defines': [ 'GIT_WINHTTP', ], + 'link_settings': { + 'libraries': [ + '-lcrypt32.lib', + '-lrpcrt4.lib', + '-lwinhttp.lib', + '-lws2_32.lib', + ], + }, 'msvs_settings': { - 'VCLinkerTool': { - 'AdditionalDependencies': [ - 'winhttp.lib', - 'ws2_32.lib', - ], - }, # Workaround of a strange bug: # TargetMachine + static_library + x64 = nothing. 'conditions': [ From 5a75ae37d650c5d54497eb24fa1b65e5f3ee09ad Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 13:16:31 +0800 Subject: [PATCH 089/194] 4.0.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 756ff717..e13746e0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.0.4", + "version": "4.0.5", "licenses": [ { "type": "MIT", From ca95e13db136a224935b3bb29202869547f7d316 Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 2 Nov 2015 16:08:49 -0500 Subject: [PATCH 090/194] ++libgit2 --- deps/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libgit2 b/deps/libgit2 index 21e7015c..db1edf91 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit 21e7015ca3425e396c2b7cc03ac67e297a646c91 +Subproject commit db1edf91e9ba9e82e6534c445008703766b5a6da From f8c6f9b81b90b46fe1bcb0ba211fd60067996ed2 Mon Sep 17 00:00:00 2001 From: joshaber Date: Thu, 5 Nov 2015 15:13:36 -0500 Subject: [PATCH 091/194] 4.0.6-0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e13746e0..b82211a2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.0.5", + "version": "4.0.6-0", "licenses": [ { "type": "MIT", From bee039af4059c16d7ba177845c54ba07ca52ee05 Mon Sep 17 00:00:00 2001 From: joshaber Date: Thu, 5 Nov 2015 16:31:07 -0500 Subject: [PATCH 092/194] 4.0.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b82211a2..e0a6a65e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.0.6-0", + "version": "4.0.6", "licenses": [ { "type": "MIT", From 2757703695f21ae59a0fdf5b21b25e9d29fd9697 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 5 Nov 2015 15:12:26 -0800 Subject: [PATCH 093/194] licenses -> license --- package.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/package.json b/package.json index e0a6a65e..6e3e5cf3 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,7 @@ "name": "git-utils", "description": "A package for using Git repositories", "version": "4.0.6", - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/atom/git-utils/raw/master/LICENSE.md" - } - ], + "license": "MIT", "author": { "name": "Kevin Sawicki", "email": "kevin@github.com" From 5f4d3ac6a381c6d64285e220818c79d2e81b0994 Mon Sep 17 00:00:00 2001 From: joshaber Date: Thu, 5 Nov 2015 23:33:25 -0500 Subject: [PATCH 094/194] merge_file.h is :hocho: --- binding.gyp | 1 - 1 file changed, 1 deletion(-) diff --git a/binding.gyp b/binding.gyp index 3eccd5b1..35e3bb78 100644 --- a/binding.gyp +++ b/binding.gyp @@ -141,7 +141,6 @@ 'deps/libgit2/src/merge.c', 'deps/libgit2/src/merge.h', 'deps/libgit2/src/merge_file.c', - 'deps/libgit2/src/merge_file.h', 'deps/libgit2/src/message.c', 'deps/libgit2/src/message.h', 'deps/libgit2/src/mwindow.c', From 57177bcc710055b94838dcc49d08bcf9d7d2af1e Mon Sep 17 00:00:00 2001 From: joshaber Date: Thu, 5 Nov 2015 23:33:43 -0500 Subject: [PATCH 095/194] 4.0.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6e3e5cf3..914d2918 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.0.6", + "version": "4.0.7", "license": "MIT", "author": { "name": "Kevin Sawicki", From 16f5e99abf2ac9aae06f07d6e1e92abf5e36ee90 Mon Sep 17 00:00:00 2001 From: Valerii Iatsko Date: Tue, 29 Dec 2015 19:00:52 +0100 Subject: [PATCH 096/194] Fix build on systems other than Windows --- binding.gyp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index 35e3bb78..242ca9aa 100644 --- a/binding.gyp +++ b/binding.gyp @@ -289,6 +289,9 @@ 'defines': [ 'GIT_WINHTTP', ], + 'include_dirs': [ + 'deps/libgit2/deps/regex', + ], 'link_settings': { 'libraries': [ '-lcrypt32.lib', @@ -383,7 +386,6 @@ 'include_dirs': [ 'deps/libgit2/include', 'deps/libgit2/src', - 'deps/libgit2/deps/regex', ], 'direct_dependent_settings': { 'include_dirs': [ @@ -422,7 +424,6 @@ ], 'include_dirs': [ 'deps/libgit2/include', - 'deps/libgit2/deps/regex', ], 'direct_dependent_settings': { 'include_dirs': [ @@ -434,6 +435,9 @@ 'msvs_disabled_warnings': [ 4005, # macro redefinition ], + 'include_dirs': [ + 'deps/libgit2/deps/regex', + ], }], ], }, From 455f49d27c3402f97454b01741d5e4eea945ff16 Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 1 Jan 2016 14:41:55 -0500 Subject: [PATCH 097/194] 4.0.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 914d2918..54cf6c2d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.0.7", + "version": "4.0.8", "license": "MIT", "author": { "name": "Kevin Sawicki", From e9ff4ba5a1ac118867068d95993681d9b1b2a2f2 Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 1 Jan 2016 16:38:23 -0500 Subject: [PATCH 098/194] Added getStatusForPaths. --- src/repository.cc | 43 +++++++++++++++++++++++++++++++++++++++++++ src/repository.h | 1 + 2 files changed, 44 insertions(+) diff --git a/src/repository.cc b/src/repository.cc index 7e9d76ae..2b01e59c 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -48,6 +48,8 @@ void Repository::Init(Local target) { Nan::SetMethod(proto, "getConfigValue", Repository::GetConfigValue); Nan::SetMethod(proto, "setConfigValue", Repository::SetConfigValue); Nan::SetMethod(proto, "getStatus", Repository::GetStatus); + Nan::SetMethod(proto, "getStatusForPaths", + Repository::GetStatusForPaths); Nan::SetMethod(proto, "checkoutHead", Repository::CheckoutHead); Nan::SetMethod(proto, "getReferenceTarget", Repository::GetReferenceTarget); Nan::SetMethod(proto, "getDiffStats", Repository::GetDiffStats); @@ -326,6 +328,47 @@ NAN_METHOD(Repository::GetStatus) { } } +NAN_METHOD(Repository::GetStatusForPaths) { + Nan::HandleScope scope; + Local result = Nan::New(); + std::map statuses; + git_status_options options = GIT_STATUS_OPTIONS_INIT; + options.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | + GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS | + GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH; + + Array *pathsArg = Array::Cast(*info[0]); + unsigned int pathsLength = pathsArg->Length(); + char *path = NULL; + char **paths = reinterpret_cast(malloc(pathsLength * sizeof(path))); + for (unsigned int i = 0; i < pathsLength; i++) { + String::Utf8Value utf8Path(pathsArg->Get(i)); + path = strdup(*utf8Path); + paths[i] = path; + } + + git_strarray pathsArray; + pathsArray.count = pathsLength; + pathsArray.strings = paths; + options.pathspec = pathsArray; + + if (git_status_foreach_ext(GetRepository(info), + &options, + StatusCallback, + &statuses) == GIT_OK) { + std::map::iterator iter = statuses.begin(); + for (; iter != statuses.end(); ++iter) + result->Set(Nan::New(iter->first.c_str()).ToLocalChecked(), + Nan::New(iter->second)); + } + + if (paths != NULL) { + git_strarray_free(&pathsArray); + } + + return info.GetReturnValue().Set(result); +} + NAN_METHOD(Repository::CheckoutHead) { Nan::HandleScope scope; if (info.Length() < 1) diff --git a/src/repository.h b/src/repository.h index 9f78f36b..3d9f0574 100644 --- a/src/repository.h +++ b/src/repository.h @@ -46,6 +46,7 @@ class Repository : public Nan::ObjectWrap { static NAN_METHOD(GetConfigValue); static NAN_METHOD(SetConfigValue); static NAN_METHOD(GetStatus); + static NAN_METHOD(GetStatusForPaths); static NAN_METHOD(CheckoutHead); static NAN_METHOD(GetReferenceTarget); static NAN_METHOD(GetDiffStats); From c23358d3aafb0f1f9500f600cb35a8bccc4b87e6 Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 1 Jan 2016 16:38:29 -0500 Subject: [PATCH 099/194] Test it. --- spec/git-spec.coffee | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 88cc5d41..a877d67c 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -453,6 +453,24 @@ describe "git", -> it 'returns the status of the given path', -> expect(repo.getStatus('a.txt')).toBe 1 << 9 + describe '.getStatusForPaths([paths])', -> + beforeEach -> + repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + + newDir = path.join(repo.getWorkingDirectory(), 'secret-stuff') + fs.mkdirSync(newDir) + + newFilePath = path.join(newDir, 'b.txt') + fs.writeFileSync(newFilePath, '', 'utf8') + + describe 'when a path is specified', -> + it 'returns the status of only that path', -> + statuses = repo.getStatusForPaths(['secret-stuff']) + expect(_.keys(statuses).length).toBe 1 + expect(statuses['secret-stuff/b.txt']).toBe 1 << 7 + describe '.getAheadBehindCount()', -> beforeEach -> repoDirectory = temp.mkdirSync('node-git-repo-') From bee72c22006f4d14084a408c3ba438d367656030 Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 4 Jan 2016 15:32:04 -0500 Subject: [PATCH 100/194] Bail early if we're not given an arg or any paths. --- src/repository.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/repository.cc b/src/repository.cc index 2b01e59c..fe7171de 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -330,7 +330,11 @@ NAN_METHOD(Repository::GetStatus) { NAN_METHOD(Repository::GetStatusForPaths) { Nan::HandleScope scope; + Local result = Nan::New(); + if (info.Length() < 1) + return info.GetReturnValue().Set(result); + std::map statuses; git_status_options options = GIT_STATUS_OPTIONS_INIT; options.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | @@ -339,6 +343,9 @@ NAN_METHOD(Repository::GetStatusForPaths) { Array *pathsArg = Array::Cast(*info[0]); unsigned int pathsLength = pathsArg->Length(); + if (pathsLength < 1) + return info.GetReturnValue().Set(result); + char *path = NULL; char **paths = reinterpret_cast(malloc(pathsLength * sizeof(path))); for (unsigned int i = 0; i < pathsLength; i++) { From a656d0bab4de5b9f6b9f9cb694729c70c577f2ce Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 4 Jan 2016 15:32:12 -0500 Subject: [PATCH 101/194] Test the empty conditions. --- spec/git-spec.coffee | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index a877d67c..77cd7f96 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -471,6 +471,21 @@ describe "git", -> expect(_.keys(statuses).length).toBe 1 expect(statuses['secret-stuff/b.txt']).toBe 1 << 7 + describe 'when no path is specified', -> + it 'returns an empty object', -> + statuses = repo.getStatusForPaths() + expect(_.keys(statuses).length).toBe 0 + + describe 'when an empty array is specified', -> + it 'returns an empty object', -> + statuses = repo.getStatusForPaths([]) + expect(_.keys(statuses).length).toBe 0 + + describe 'when an empty string is specified', -> + it 'returns an empty object', -> + statuses = repo.getStatusForPaths(['']) + expect(_.keys(statuses).length).toBe 0 + describe '.getAheadBehindCount()', -> beforeEach -> repoDirectory = temp.mkdirSync('node-git-repo-') From b5bb0a4351aa3108221adeea945fdb9c4b36fadb Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 4 Jan 2016 16:22:30 -0500 Subject: [PATCH 102/194] 4.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 54cf6c2d..f7a1a4bc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.0.8", + "version": "4.1.0", "license": "MIT", "author": { "name": "Kevin Sawicki", From 0a61c1e8a86ea271d9f739fd2a33d64463d07239 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 10 Feb 2016 11:39:51 -0500 Subject: [PATCH 103/194] Add fixture with a subdirectory. --- spec/fixtures/subdir.git/COMMIT_EDITMSG | 10 ++ spec/fixtures/subdir.git/HEAD | 1 + spec/fixtures/subdir.git/config | 7 + spec/fixtures/subdir.git/description | 1 + .../subdir.git/hooks/applypatch-msg.sample | 15 ++ .../subdir.git/hooks/commit-msg.sample | 24 +++ .../subdir.git/hooks/post-update.sample | 8 + .../subdir.git/hooks/pre-applypatch.sample | 14 ++ .../subdir.git/hooks/pre-commit.sample | 49 +++++ .../fixtures/subdir.git/hooks/pre-push.sample | 53 ++++++ .../subdir.git/hooks/pre-rebase.sample | 169 ++++++++++++++++++ .../hooks/prepare-commit-msg.sample | 36 ++++ spec/fixtures/subdir.git/hooks/update.sample | 128 +++++++++++++ spec/fixtures/subdir.git/index | Bin 0 -> 165 bytes spec/fixtures/subdir.git/info/exclude | 6 + spec/fixtures/subdir.git/logs/HEAD | 1 + .../subdir.git/logs/refs/heads/master | 1 + .../01/61b71e6fec1c93588328e95a1b35d29dc11535 | 2 + .../65/a457425a679cbe9adf0d2741785d3ceabb44a7 | Bin 0 -> 50 bytes .../93/1b5389b49cf064be5ee1eb81ff95f7ccdfff47 | Bin 0 -> 45 bytes .../e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 | Bin 0 -> 15 bytes spec/fixtures/subdir.git/refs/heads/master | 1 + 22 files changed, 526 insertions(+) create mode 100644 spec/fixtures/subdir.git/COMMIT_EDITMSG create mode 100644 spec/fixtures/subdir.git/HEAD create mode 100644 spec/fixtures/subdir.git/config create mode 100644 spec/fixtures/subdir.git/description create mode 100755 spec/fixtures/subdir.git/hooks/applypatch-msg.sample create mode 100755 spec/fixtures/subdir.git/hooks/commit-msg.sample create mode 100755 spec/fixtures/subdir.git/hooks/post-update.sample create mode 100755 spec/fixtures/subdir.git/hooks/pre-applypatch.sample create mode 100755 spec/fixtures/subdir.git/hooks/pre-commit.sample create mode 100755 spec/fixtures/subdir.git/hooks/pre-push.sample create mode 100755 spec/fixtures/subdir.git/hooks/pre-rebase.sample create mode 100755 spec/fixtures/subdir.git/hooks/prepare-commit-msg.sample create mode 100755 spec/fixtures/subdir.git/hooks/update.sample create mode 100644 spec/fixtures/subdir.git/index create mode 100644 spec/fixtures/subdir.git/info/exclude create mode 100644 spec/fixtures/subdir.git/logs/HEAD create mode 100644 spec/fixtures/subdir.git/logs/refs/heads/master create mode 100644 spec/fixtures/subdir.git/objects/01/61b71e6fec1c93588328e95a1b35d29dc11535 create mode 100644 spec/fixtures/subdir.git/objects/65/a457425a679cbe9adf0d2741785d3ceabb44a7 create mode 100644 spec/fixtures/subdir.git/objects/93/1b5389b49cf064be5ee1eb81ff95f7ccdfff47 create mode 100644 spec/fixtures/subdir.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 create mode 100644 spec/fixtures/subdir.git/refs/heads/master diff --git a/spec/fixtures/subdir.git/COMMIT_EDITMSG b/spec/fixtures/subdir.git/COMMIT_EDITMSG new file mode 100644 index 00000000..9d4e7727 --- /dev/null +++ b/spec/fixtures/subdir.git/COMMIT_EDITMSG @@ -0,0 +1,10 @@ +first +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# On branch master +# +# Initial commit +# +# Changes to be committed: +# new file: dir/a.txt +# diff --git a/spec/fixtures/subdir.git/HEAD b/spec/fixtures/subdir.git/HEAD new file mode 100644 index 00000000..cb089cd8 --- /dev/null +++ b/spec/fixtures/subdir.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/spec/fixtures/subdir.git/config b/spec/fixtures/subdir.git/config new file mode 100644 index 00000000..6c9406b7 --- /dev/null +++ b/spec/fixtures/subdir.git/config @@ -0,0 +1,7 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true diff --git a/spec/fixtures/subdir.git/description b/spec/fixtures/subdir.git/description new file mode 100644 index 00000000..498b267a --- /dev/null +++ b/spec/fixtures/subdir.git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/spec/fixtures/subdir.git/hooks/applypatch-msg.sample b/spec/fixtures/subdir.git/hooks/applypatch-msg.sample new file mode 100755 index 00000000..a5d7b84a --- /dev/null +++ b/spec/fixtures/subdir.git/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/spec/fixtures/subdir.git/hooks/commit-msg.sample b/spec/fixtures/subdir.git/hooks/commit-msg.sample new file mode 100755 index 00000000..b58d1184 --- /dev/null +++ b/spec/fixtures/subdir.git/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/spec/fixtures/subdir.git/hooks/post-update.sample b/spec/fixtures/subdir.git/hooks/post-update.sample new file mode 100755 index 00000000..ec17ec19 --- /dev/null +++ b/spec/fixtures/subdir.git/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/spec/fixtures/subdir.git/hooks/pre-applypatch.sample b/spec/fixtures/subdir.git/hooks/pre-applypatch.sample new file mode 100755 index 00000000..4142082b --- /dev/null +++ b/spec/fixtures/subdir.git/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/spec/fixtures/subdir.git/hooks/pre-commit.sample b/spec/fixtures/subdir.git/hooks/pre-commit.sample new file mode 100755 index 00000000..68d62d54 --- /dev/null +++ b/spec/fixtures/subdir.git/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/spec/fixtures/subdir.git/hooks/pre-push.sample b/spec/fixtures/subdir.git/hooks/pre-push.sample new file mode 100755 index 00000000..6187dbf4 --- /dev/null +++ b/spec/fixtures/subdir.git/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +z40=0000000000000000000000000000000000000000 + +while read local_ref local_sha remote_ref remote_sha +do + if [ "$local_sha" = $z40 ] + then + # Handle delete + : + else + if [ "$remote_sha" = $z40 ] + then + # New branch, examine all commits + range="$local_sha" + else + # Update to existing branch, examine new commits + range="$remote_sha..$local_sha" + fi + + # Check for WIP commit + commit=`git rev-list -n 1 --grep '^WIP' "$range"` + if [ -n "$commit" ] + then + echo >&2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/spec/fixtures/subdir.git/hooks/pre-rebase.sample b/spec/fixtures/subdir.git/hooks/pre-rebase.sample new file mode 100755 index 00000000..9773ed4c --- /dev/null +++ b/spec/fixtures/subdir.git/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up-to-date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +exit 0 + +################################################################ + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". diff --git a/spec/fixtures/subdir.git/hooks/prepare-commit-msg.sample b/spec/fixtures/subdir.git/hooks/prepare-commit-msg.sample new file mode 100755 index 00000000..f093a02e --- /dev/null +++ b/spec/fixtures/subdir.git/hooks/prepare-commit-msg.sample @@ -0,0 +1,36 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first comments out the +# "Conflicts:" part of a merge commit. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +case "$2,$3" in + merge,) + /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$1" ;; + + *) ;; +esac + +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/spec/fixtures/subdir.git/hooks/update.sample b/spec/fixtures/subdir.git/hooks/update.sample new file mode 100755 index 00000000..d8475837 --- /dev/null +++ b/spec/fixtures/subdir.git/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to blocks unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --bool hooks.allowunannotated) +allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +denycreatebranch=$(git config --bool hooks.denycreatebranch) +allowdeletetag=$(git config --bool hooks.allowdeletetag) +allowmodifytag=$(git config --bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then + newrev_type=delete +else + newrev_type=$(git cat-file -t $newrev) +fi + +case "$refname","$newrev_type" in + refs/tags/*,commit) + # un-annotated tag + short_refname=${refname##refs/tags/} + if [ "$allowunannotated" != "true" ]; then + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/spec/fixtures/subdir.git/index b/spec/fixtures/subdir.git/index new file mode 100644 index 0000000000000000000000000000000000000000..7307df297dc5ae7e795c87015ad9975470747820 GIT binary patch literal 165 zcmZ?q402{*U|<4b#<1OK^+1{dMl&)nu&`GvXfrT0E&)n^1xks4 1455122054 -0500 commit (initial): first diff --git a/spec/fixtures/subdir.git/logs/refs/heads/master b/spec/fixtures/subdir.git/logs/refs/heads/master new file mode 100644 index 00000000..014e0c37 --- /dev/null +++ b/spec/fixtures/subdir.git/logs/refs/heads/master @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 0161b71e6fec1c93588328e95a1b35d29dc11535 joshaber 1455122054 -0500 commit (initial): first diff --git a/spec/fixtures/subdir.git/objects/01/61b71e6fec1c93588328e95a1b35d29dc11535 b/spec/fixtures/subdir.git/objects/01/61b71e6fec1c93588328e95a1b35d29dc11535 new file mode 100644 index 00000000..e9b46fa6 --- /dev/null +++ b/spec/fixtures/subdir.git/objects/01/61b71e6fec1c93588328e95a1b35d29dc11535 @@ -0,0 +1,2 @@ +xA +à E»ös'™I"„Ы¨i,Á˜û×MöÝ=>ïóbÉ95À‰n­Š€1ð¸¸@.ª(‹ „UëãKUi6þl{©ð)ÇîƒTX/z¾³OßG,y$fËwËÖš¾ö\ëþ¥ÿy4šêÑÌí<6 \ No newline at end of file diff --git a/spec/fixtures/subdir.git/objects/65/a457425a679cbe9adf0d2741785d3ceabb44a7 b/spec/fixtures/subdir.git/objects/65/a457425a679cbe9adf0d2741785d3ceabb44a7 new file mode 100644 index 0000000000000000000000000000000000000000..ba1f06fc0e5703e15be021b473eb64a7063688ae GIT binary patch literal 50 zcmb0V^p=O;s>9U@$QN0)>>!B8Jo@;Z9NMbN0=;&#UfO5o_~mx65(>=jaX7 Dk_8n0 literal 0 HcmV?d00001 diff --git a/spec/fixtures/subdir.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/spec/fixtures/subdir.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 new file mode 100644 index 0000000000000000000000000000000000000000..711223894375fe1186ac5bfffdc48fb1fa1e65cc GIT binary patch literal 15 Wcmb Date: Wed, 10 Feb 2016 12:52:08 -0500 Subject: [PATCH 104/194] Stop linting C++ for now. --- Gruntfile.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 79a107cd..b5d66bcb 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -51,7 +51,7 @@ module.exports = (grunt) -> grunt.loadNpmTasks('grunt-shell') grunt.loadNpmTasks('grunt-coffeelint') grunt.loadNpmTasks('node-cpplint') - grunt.registerTask('lint', ['coffeelint', 'cpplint']) + grunt.registerTask('lint', ['coffeelint']) grunt.registerTask('default', ['coffee', 'lint', 'shell:rebuild']) grunt.registerTask('test', ['default', 'shell:test']) grunt.registerTask 'clean', -> From 2ebc61841cdda3b7803993a38528584498a508e1 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 10 Feb 2016 12:55:15 -0500 Subject: [PATCH 105/194] Log the status we get back from libgit2. --- src/repository.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/repository.cc b/src/repository.cc index fe7171de..0abaf606 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -25,6 +25,7 @@ #include #include +#include void Repository::Init(Local target) { Nan::HandleScope scope; @@ -583,6 +584,7 @@ NAN_METHOD(Repository::GetIndexBlob) { int Repository::StatusCallback( const char* path, unsigned int status, void* payload) { + std::cout << "HEY THERE: " << status << "\n"; std::map* statuses = static_cast*>(payload); statuses->insert(std::make_pair(std::string(path), status)); From e5da7f301b262a68f5100797118a659a9a69addc Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 10 Feb 2016 12:55:20 -0500 Subject: [PATCH 106/194] Failing tests. --- spec/git-spec.coffee | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 77cd7f96..418de350 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -453,23 +453,34 @@ describe "git", -> it 'returns the status of the given path', -> expect(repo.getStatus('a.txt')).toBe 1 << 9 - describe '.getStatusForPaths([paths])', -> + fdescribe '.getStatusForPaths([paths])', -> + repoDirectory = null + filePath = null beforeEach -> repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + console.log(repoDirectory) + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/subdir.git'), path.join(repoDirectory, '.git')) repo = git.open(repoDirectory) - newDir = path.join(repo.getWorkingDirectory(), 'secret-stuff') - fs.mkdirSync(newDir) - - newFilePath = path.join(newDir, 'b.txt') - fs.writeFileSync(newFilePath, '', 'utf8') + dir = path.join(repo.getWorkingDirectory(), 'dir') + filePath = path.join(dir, 'a.txt') + fs.writeFileSync(filePath, 'hey there', 'utf8') describe 'when a path is specified', -> it 'returns the status of only that path', -> - statuses = repo.getStatusForPaths(['secret-stuff']) + statuses = repo.getStatusForPaths(['dir']) expect(_.keys(statuses).length).toBe 1 - expect(statuses['secret-stuff/b.txt']).toBe 1 << 7 + + status = statuses['dir/a.txt'] + console.log(status) + expect(repo.isStatusModified(status)).toBe true + expect(repo.isStatusNew(status)).toBe false + + it 'returns the status of only that path2', -> + fs.writeFileSync(filePath, '', 'utf8') + + statuses = repo.getStatusForPaths(['dir']) + expect(_.keys(statuses).length).toBe 0 describe 'when no path is specified', -> it 'returns an empty object', -> From d71ac64199c4e667f86f1fadf591f028cfa999a3 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 10 Feb 2016 13:55:32 -0500 Subject: [PATCH 107/194] No mo logging. --- src/repository.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index 0abaf606..fe7171de 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -25,7 +25,6 @@ #include #include -#include void Repository::Init(Local target) { Nan::HandleScope scope; @@ -584,7 +583,6 @@ NAN_METHOD(Repository::GetIndexBlob) { int Repository::StatusCallback( const char* path, unsigned int status, void* payload) { - std::cout << "HEY THERE: " << status << "\n"; std::map* statuses = static_cast*>(payload); statuses->insert(std::make_pair(std::string(path), status)); From b5b4a7035c4e458ed7f83cc8be8762b1fb38dc85 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 10 Feb 2016 13:55:41 -0500 Subject: [PATCH 108/194] Enable pathspec matching. --- src/repository.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index fe7171de..97135088 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -338,8 +338,7 @@ NAN_METHOD(Repository::GetStatusForPaths) { std::map statuses; git_status_options options = GIT_STATUS_OPTIONS_INIT; options.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | - GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS | - GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH; + GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS; Array *pathsArg = Array::Cast(*info[0]); unsigned int pathsLength = pathsArg->Length(); From d283e9941f599f0a1fe083db7cc45a0360b35f3c Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 10 Feb 2016 13:55:50 -0500 Subject: [PATCH 109/194] Use the glob. --- spec/git-spec.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 418de350..13dc6c9a 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -468,7 +468,7 @@ describe "git", -> describe 'when a path is specified', -> it 'returns the status of only that path', -> - statuses = repo.getStatusForPaths(['dir']) + statuses = repo.getStatusForPaths(['dir/**']) expect(_.keys(statuses).length).toBe 1 status = statuses['dir/a.txt'] @@ -479,7 +479,7 @@ describe "git", -> it 'returns the status of only that path2', -> fs.writeFileSync(filePath, '', 'utf8') - statuses = repo.getStatusForPaths(['dir']) + statuses = repo.getStatusForPaths(['dir/**']) expect(_.keys(statuses).length).toBe 0 describe 'when no path is specified', -> @@ -495,7 +495,7 @@ describe "git", -> describe 'when an empty string is specified', -> it 'returns an empty object', -> statuses = repo.getStatusForPaths(['']) - expect(_.keys(statuses).length).toBe 0 + expect(_.keys(statuses).length).toBe 1 describe '.getAheadBehindCount()', -> beforeEach -> From fb8a7f2d32c443a5669e2105226be5184e097ad1 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 10 Feb 2016 13:56:18 -0500 Subject: [PATCH 110/194] Bring back linting. --- Gruntfile.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index b5d66bcb..79a107cd 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -51,7 +51,7 @@ module.exports = (grunt) -> grunt.loadNpmTasks('grunt-shell') grunt.loadNpmTasks('grunt-coffeelint') grunt.loadNpmTasks('node-cpplint') - grunt.registerTask('lint', ['coffeelint']) + grunt.registerTask('lint', ['coffeelint', 'cpplint']) grunt.registerTask('default', ['coffee', 'lint', 'shell:rebuild']) grunt.registerTask('test', ['default', 'shell:test']) grunt.registerTask 'clean', -> From 45290c34a6dccbb05da4bbfa109f044ee5e0f3bd Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 10 Feb 2016 13:57:05 -0500 Subject: [PATCH 111/194] Unfocus. --- spec/git-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index 13dc6c9a..deab1326 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -453,7 +453,7 @@ describe "git", -> it 'returns the status of the given path', -> expect(repo.getStatus('a.txt')).toBe 1 << 9 - fdescribe '.getStatusForPaths([paths])', -> + describe '.getStatusForPaths([paths])', -> repoDirectory = null filePath = null beforeEach -> From 3645e8692539b93199c170724703cc75cac6b46b Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 10 Feb 2016 14:02:59 -0500 Subject: [PATCH 112/194] Acknowledge that we *should* be using GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH. --- src/repository.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/repository.cc b/src/repository.cc index 97135088..02ce9125 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -337,6 +337,9 @@ NAN_METHOD(Repository::GetStatusForPaths) { std::map statuses; git_status_options options = GIT_STATUS_OPTIONS_INIT; + // Ideally we'd use GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH here since we want + // to limit to a path, not a pathspec, but libgit2 seems to have a bug here: + // https://github.com/libgit2/libgit2/pull/3609 options.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS; From 6dbba456736150d6d400f5f54938793ccf316ff1 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 10 Feb 2016 14:10:41 -0500 Subject: [PATCH 113/194] Prepare 4.1.1 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f7a1a4bc..51277038 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.1.0", + "version": "4.1.1", "license": "MIT", "author": { "name": "Kevin Sawicki", From 7c6c2fd5650233d0e5d4bdee80f04f574ed5ff83 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 10 Feb 2016 14:13:59 -0500 Subject: [PATCH 114/194] Prepare 4.1.2 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 51277038..55ff38e8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.1.1", + "version": "4.1.2", "license": "MIT", "author": { "name": "Kevin Sawicki", From 8a76ca2fbda87082722f74b3de814cd66bab5342 Mon Sep 17 00:00:00 2001 From: Yoshimasa Niwa Date: Mon, 21 Mar 2016 01:48:27 -0700 Subject: [PATCH 115/194] Upgrade libgit2 to 0.24.0 --- deps/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libgit2 b/deps/libgit2 index db1edf91..785d8c48 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit db1edf91e9ba9e82e6534c445008703766b5a6da +Subproject commit 785d8c48ea8725691da3c50e7dae8751523d4c30 From dc5db3abd6fe465957966f775294e6bde8532a03 Mon Sep 17 00:00:00 2001 From: Yoshimasa Niwa Date: Sun, 5 Jun 2016 13:29:21 -0700 Subject: [PATCH 116/194] Upgrade libgit2 to 0.24.1. --- deps/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libgit2 b/deps/libgit2 index 785d8c48..211e117a 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit 785d8c48ea8725691da3c50e7dae8751523d4c30 +Subproject commit 211e117a0590583a720c53172406f34186c543bd From e6e6e22fbcaa5ac4d0bf90f03545dd01626b05c2 Mon Sep 17 00:00:00 2001 From: Yoshimasa Niwa Date: Fri, 28 Oct 2016 17:02:00 -0700 Subject: [PATCH 117/194] Upgrade libgit2 to 0.24.2. --- deps/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libgit2 b/deps/libgit2 index 211e117a..8e268168 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit 211e117a0590583a720c53172406f34186c543bd +Subproject commit 8e268168ecfdcc8efe36b58b514d1b93ea3f47f8 From 8dfc25b0a2df0cd7aff5b72fee32f65a835783f9 Mon Sep 17 00:00:00 2001 From: Yoshimasa Niwa Date: Fri, 28 Oct 2016 23:27:07 -0700 Subject: [PATCH 118/194] Workaround clang-3.4 with node 0.10 error. --- binding.gyp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/binding.gyp b/binding.gyp index 242ca9aa..6451800d 100644 --- a/binding.gyp +++ b/binding.gyp @@ -23,6 +23,9 @@ 'cflags': [ '-Wno-missing-field-initializers', ], + 'cflags_cc!': [ + '-fno-delete-null-pointer-checks', # clang-3.4 doesn't understand this flag and fails. + ], 'xcode_settings': { 'WARNING_CFLAGS': [ '-Wno-missing-field-initializers', From 3b11d25d3695da8a57172e6f2182cdaef9f62a7c Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Mon, 21 Nov 2016 14:57:35 -0800 Subject: [PATCH 119/194] :arrow_up: libgit2 to v0.24.3 --- deps/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libgit2 b/deps/libgit2 index 8e268168..4cf1ec7c 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit 8e268168ecfdcc8efe36b58b514d1b93ea3f47f8 +Subproject commit 4cf1ec7cff28da8838a2f0a9fb330e312ea3f963 From 65fb197955a5b2126afe0202a7504a6b41b0ed57 Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Mon, 21 Nov 2016 16:48:04 -0800 Subject: [PATCH 120/194] Prepare 4.1.3 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 55ff38e8..400aa0c9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.1.2", + "version": "4.1.3", "license": "MIT", "author": { "name": "Kevin Sawicki", From d1668ede9b5b7df284cdaf7fc0f2bac856659a78 Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Mon, 21 Nov 2016 19:34:06 -0800 Subject: [PATCH 121/194] libgit2 renamed pthread -> thread in a patch release --- binding.gyp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index 6451800d..fed15dec 100644 --- a/binding.gyp +++ b/binding.gyp @@ -347,8 +347,8 @@ 'deps/libgit2/src/win32/posix_w32.c', 'deps/libgit2/src/win32/precompiled.c', 'deps/libgit2/src/win32/precompiled.h', - 'deps/libgit2/src/win32/pthread.c', - 'deps/libgit2/src/win32/pthread.h', + 'deps/libgit2/src/win32/thread.c', + 'deps/libgit2/src/win32/thread.h', 'deps/libgit2/src/win32/reparse.h', 'deps/libgit2/src/win32/utf-conv.c', 'deps/libgit2/src/win32/utf-conv.h', From cd4b19d906850fd3a924a6d2075c9399e6fda94e Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Mon, 21 Nov 2016 19:54:05 -0800 Subject: [PATCH 122/194] 4.1.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 400aa0c9..ff595ab9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.1.3", + "version": "4.1.4", "license": "MIT", "author": { "name": "Kevin Sawicki", From 368bc3dbaeba3eddd111f4cbf330cfa30ade7465 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 6 Mar 2017 11:40:16 +0100 Subject: [PATCH 123/194] :arrow_up: fs-plus --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ff595ab9..4c630525 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ }, "dependencies": { "nan": "^2.0.0", - "fs-plus": "^2.1.0" + "fs-plus": "^3.0.0" }, "scripts": { "prepublish": "grunt clean coffee lint", From 307ba1a9bf4d22afd483dbe01858de9c46c637c0 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 6 Mar 2017 11:40:21 +0100 Subject: [PATCH 124/194] 5.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4c630525..0d25b1ee 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "4.1.4", + "version": "5.0.0", "license": "MIT", "author": { "name": "Kevin Sawicki", From a68918140eabeb1199723152255e91d90a7b1fa8 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 6 Mar 2017 11:45:39 +0100 Subject: [PATCH 125/194] Test only Node 6 on Travis --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 486c3726..a69704d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,7 @@ notifications: on_success: never on_failure: change -node_js: - - "0.10" - - "4.0" +node_js: 6 git: depth: 10 From 6b7f92b2a6a5d40f6fdaac9c66fb91b1f87377ea Mon Sep 17 00:00:00 2001 From: billybonks Date: Thu, 22 Jun 2017 12:27:14 +0800 Subject: [PATCH 126/194] Update libgit2 v0.26.0 --- binding.gyp | 28 ++++++++++++++++++++++++---- deps/libgit2 | 2 +- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/binding.gyp b/binding.gyp index fed15dec..89ddb1b5 100644 --- a/binding.gyp +++ b/binding.gyp @@ -40,6 +40,7 @@ 'type': 'static_library', 'defines': [ 'GIT_THREADS', + 'GIT_USE_STAT_MTIMESPEC', # Node's util.h may be accidentally included so use this to guard # against compilation error. 'SRC_UTIL_H_', @@ -49,6 +50,8 @@ 'http_parser', ], 'sources': [ + 'deps/libgit2/src/apply.h', + 'deps/libgit2/src/apply.c', 'deps/libgit2/src/annotated_commit.c', 'deps/libgit2/src/annotated_commit.h', 'deps/libgit2/src/array.h', @@ -93,8 +96,8 @@ 'deps/libgit2/src/curl_stream.c', 'deps/libgit2/src/curl_stream.h', 'deps/libgit2/src/date.c', - 'deps/libgit2/src/delta-apply.c', - 'deps/libgit2/src/delta-apply.h', + 'deps/libgit2/src/delta.c', + 'deps/libgit2/src/delta.h', 'deps/libgit2/src/delta.c', 'deps/libgit2/src/delta.h', 'deps/libgit2/src/describe.c', @@ -104,11 +107,14 @@ 'deps/libgit2/src/diff_driver.h', 'deps/libgit2/src/diff_file.c', 'deps/libgit2/src/diff_file.h', - 'deps/libgit2/src/diff_patch.c', - 'deps/libgit2/src/diff_patch.h', + 'deps/libgit2/src/diff_generate.c', + 'deps/libgit2/src/diff_generate.h', 'deps/libgit2/src/diff_print.c', + 'deps/libgit2/src/diff_parse.c', + 'deps/libgit2/src/diff_parse.h', 'deps/libgit2/src/diff_stats.c', 'deps/libgit2/src/diff_tform.c', + 'deps/libgit2/src/diff_tform.c', 'deps/libgit2/src/diff_xdiff.c', 'deps/libgit2/src/diff_xdiff.h', 'deps/libgit2/src/errors.c', @@ -131,6 +137,8 @@ 'deps/libgit2/src/hash.h', 'deps/libgit2/src/hashsig.c', 'deps/libgit2/src/ident.c', + 'deps/libgit2/src/idxmap.c', + 'deps/libgit2/src/idxmap.h', 'deps/libgit2/src/ignore.c', 'deps/libgit2/src/ignore.h', 'deps/libgit2/src/index.c', @@ -141,6 +149,8 @@ 'deps/libgit2/src/iterator.h', 'deps/libgit2/src/khash.h', 'deps/libgit2/src/map.h', + 'deps/libgit2/src/merge_driver.c', + 'deps/libgit2/src/merge_driver.h', 'deps/libgit2/src/merge.c', 'deps/libgit2/src/merge.h', 'deps/libgit2/src/merge_file.c', @@ -161,17 +171,23 @@ 'deps/libgit2/src/odb_mempack.c', 'deps/libgit2/src/odb_pack.c', 'deps/libgit2/src/offmap.h', + 'deps/libgit2/src/offmap.c', 'deps/libgit2/src/oid.c', 'deps/libgit2/src/oid.h', 'deps/libgit2/src/oidarray.c', 'deps/libgit2/src/oidarray.h', 'deps/libgit2/src/oidmap.h', + 'deps/libgit2/src/oidmap.c', 'deps/libgit2/src/openssl_stream.c', 'deps/libgit2/src/openssl_stream.h', 'deps/libgit2/src/pack-objects.c', 'deps/libgit2/src/pack-objects.h', 'deps/libgit2/src/pack.c', 'deps/libgit2/src/pack.h', + 'deps/libgit2/src/patch.c', + 'deps/libgit2/src/patch.h', + 'deps/libgit2/src/patch_generate.c', + 'deps/libgit2/src/patch_generate.h', 'deps/libgit2/src/path.c', 'deps/libgit2/src/path.h', 'deps/libgit2/src/pathspec.c', @@ -182,6 +198,8 @@ 'deps/libgit2/src/posix.h', 'deps/libgit2/src/pqueue.c', 'deps/libgit2/src/pqueue.h', + 'deps/libgit2/src/proxy.c', + 'deps/libgit2/src/proxy.h', 'deps/libgit2/src/push.c', 'deps/libgit2/src/push.h', 'deps/libgit2/src/rebase.c', @@ -248,6 +266,8 @@ 'deps/libgit2/src/util.h', 'deps/libgit2/src/vector.c', 'deps/libgit2/src/vector.h', + 'deps/libgit2/src/worktree.c', + 'deps/libgit2/src/worktree.h', 'deps/libgit2/src/zstream.c', 'deps/libgit2/src/zstream.h', 'deps/libgit2/src/transports/auth.c', diff --git a/deps/libgit2 b/deps/libgit2 index 4cf1ec7c..15e11937 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit 4cf1ec7cff28da8838a2f0a9fb330e312ea3f963 +Subproject commit 15e119375018fba121cf58e02a9f17fe22df0df8 From bf8e8b3126c6c4db3c8faf628584661a27c62bad Mon Sep 17 00:00:00 2001 From: James Adam Date: Wed, 2 Aug 2017 16:48:56 +0100 Subject: [PATCH 127/194] Allow limiting search for repositories In some cases it is useful to only open a repository if the given path points to it directly, and not travese up the directory tree trying to find one. --- README.md | 10 +++++++++- spec/git-spec.coffee | 5 +++++ src/git.coffee | 9 ++++----- src/repository.cc | 11 ++++++++--- src/repository.h | 2 +- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e5529eac..9d0e4ca1 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,14 @@ npm install git-utils ## Docs -### git.open(path) +### git.open(path, [search = true]) Open the repository at the given path. This will return `null` if the repository at the given path does not exist or cannot be opened. +`path` - The path from which to try to open a repository +`search` - Set to false if we shouldn't search up in the directory tree + ```coffeescript git = require 'git-utils' @@ -33,6 +36,11 @@ The opened repository will have a `submodules` property that will be an object of paths mapped to submodule {Repository} objects. The path keys will be relative to the opened repository's working directory. +If search is set to true (the default), all paths up to the filesystem root will +be recursively checked to try and find the root directory of a repository. If a +search is false, traversing not be performed, and a repository will only be +returned if the given path is the root of a repository. + ### Repository.checkoutHead(path) Restore the contents of a path in the working directory and index to the diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index deab1326..eeec4f11 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -28,6 +28,11 @@ describe "git", -> it "returns null", -> expect(git.open('/tmp/path/does/not/exist')).toBeNull() + describe "when limiting upwards traversal", -> + it "returns null", -> + repositorySubdirectoryPath = path.join(path.dirname(__dirname), 'spec', 'fixtures') + expect(git.open(repositorySubdirectoryPath, false)).toBeNull() + describe ".getPath()", -> it "returns the path to the .git directory", -> repositoryPath = git.open(__dirname).getPath() diff --git a/src/git.coffee b/src/git.coffee index d1927a19..1cff583f 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -197,11 +197,10 @@ isRootPath = (repositoryPath) -> else repositoryPath is path.sep -openRepository = (repositoryPath) -> +openRepository = (repositoryPath, search = true) -> symlink = realpath(repositoryPath) isnt repositoryPath - repositoryPath = repositoryPath.replace(/\\/g, '/') if process.platform is 'win32' - repository = new Repository(repositoryPath) + repository = new Repository(repositoryPath, search) if repository.exists() repository.caseInsensitiveFs = fs.isCaseInsensitive() if symlink @@ -226,7 +225,7 @@ openSubmodules = (repository) -> openSubmodules(submoduleRepo) repository.submodules[relativePath] = submoduleRepo -exports.open = (repositoryPath) -> - repository = openRepository(repositoryPath) +exports.open = (repositoryPath, search = true) -> + repository = openRepository(repositoryPath, search) openSubmodules(repository) if repository? repository diff --git a/src/repository.cc b/src/repository.cc index 02ce9125..64e5e0c5 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -72,7 +72,8 @@ NODE_MODULE(git, Repository::Init) NAN_METHOD(Repository::New) { Nan::HandleScope scope; - Repository* repository = new Repository(Local::Cast(info[0])); + Repository* repository = new Repository( + Local::Cast(info[0]), Local::Cast(info[1])); repository->Wrap(info.This()); info.GetReturnValue().SetUndefined(); } @@ -962,12 +963,16 @@ NAN_METHOD(Repository::Add) { info.GetReturnValue().Set(Nan::New(true)); } -Repository::Repository(Local path) { +Repository::Repository(Local path, Local search) { Nan::HandleScope scope; + int flags = 0; + if (!search->BooleanValue()) + flags |= GIT_REPOSITORY_OPEN_NO_SEARCH; + std::string repositoryPath(*String::Utf8Value(path)); if (git_repository_open_ext( - &repository, repositoryPath.c_str(), 0, NULL) != GIT_OK) + &repository, repositoryPath.c_str(), flags, NULL) != GIT_OK) repository = NULL; } diff --git a/src/repository.h b/src/repository.h index 3d9f0574..069a97c9 100644 --- a/src/repository.h +++ b/src/repository.h @@ -83,7 +83,7 @@ class Repository : public Nan::ObjectWrap { static git_diff_options CreateDefaultGitDiffOptions(); - explicit Repository(Local path); + explicit Repository(Local path, Local search); ~Repository(); git_repository* repository; From fcaefb0a424c558a151576e23e38d031bdd955e7 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 25 Sep 2017 16:52:13 -0700 Subject: [PATCH 128/194] Convert implementation from coffee-script to JS --- Gruntfile.coffee | 59 --------- package.json | 17 +-- spec/git-spec.coffee | 5 +- src/git.coffee | 231 ---------------------------------- src/git.js | 292 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 300 insertions(+), 304 deletions(-) delete mode 100644 Gruntfile.coffee delete mode 100644 src/git.coffee create mode 100644 src/git.js diff --git a/Gruntfile.coffee b/Gruntfile.coffee deleted file mode 100644 index 79a107cd..00000000 --- a/Gruntfile.coffee +++ /dev/null @@ -1,59 +0,0 @@ -module.exports = (grunt) -> - grunt.initConfig - pkg: grunt.file.readJSON('package.json') - - coffee: - glob_to_multiple: - expand: true - cwd: 'src' - src: ['*.coffee'] - dest: 'lib' - ext: '.js' - - coffeelint: - options: - no_empty_param_list: - level: 'error' - max_line_length: - level: 'ignore' - - gruntfile: ['Gruntfile.coffee'] - src: ['src/**/*.coffee'] - test: ['spec/**/*.coffee'] - - cpplint: - files: [ - 'src/**/*.cc' - 'src/**/*.h' - ] - reporter: 'spec' - verbosity: 1 - filters: - build: - include: false - - shell: - rebuild: - command: 'npm build .' - options: - stdout: true - stderr: true - failOnError: true - - test: - command: 'node node_modules/jasmine-focused/bin/jasmine-focused --captureExceptions --coffee spec/' - options: - stdout: true - stderr: true - failOnError: true - - grunt.loadNpmTasks('grunt-contrib-coffee') - grunt.loadNpmTasks('grunt-shell') - grunt.loadNpmTasks('grunt-coffeelint') - grunt.loadNpmTasks('node-cpplint') - grunt.registerTask('lint', ['coffeelint', 'cpplint']) - grunt.registerTask('default', ['coffee', 'lint', 'shell:rebuild']) - grunt.registerTask('test', ['default', 'shell:test']) - grunt.registerTask 'clean', -> - grunt.file.delete('lib') if grunt.file.exists('lib') - grunt.file.delete('build') if grunt.file.exists('build') diff --git a/package.json b/package.json index 0d25b1ee..d8e6cbe4 100644 --- a/package.json +++ b/package.json @@ -27,25 +27,20 @@ "dvcs", "vcs" ], - "main": "./lib/git.js", + "main": "./src/git.js", "devDependencies": { - "grunt": "~0.4.0", - "grunt-contrib-coffee": "~0.9.0", - "grunt-shell": "~0.2.1", - "grunt-cli": "~0.1.6", - "wrench": "~1.4.4", + "jasmine-focused": "^1.0.4", + "standard": "^10.0.3", "temp": "~0.5.0", "underscore": "~1.5.2", - "jasmine-focused": "^1.0.4", - "node-cpplint": "~0.1.5", - "grunt-coffeelint": "0.0.6" + "wrench": "~1.4.4" }, "dependencies": { "nan": "^2.0.0", "fs-plus": "^3.0.0" }, "scripts": { - "prepublish": "grunt clean coffee lint", - "test": "grunt test" + "prepublish": "standard src spec", + "test": "jasmine-focused --captureExceptions --coffee spec" } } diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index eeec4f11..5aba0142 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -1,4 +1,4 @@ -git = require '../lib/git' +git = require '../src/git' path = require 'path' fs = require 'fs-plus' {exec} = require 'child_process' @@ -461,9 +461,9 @@ describe "git", -> describe '.getStatusForPaths([paths])', -> repoDirectory = null filePath = null + beforeEach -> repoDirectory = temp.mkdirSync('node-git-repo-') - console.log(repoDirectory) wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/subdir.git'), path.join(repoDirectory, '.git')) repo = git.open(repoDirectory) @@ -477,7 +477,6 @@ describe "git", -> expect(_.keys(statuses).length).toBe 1 status = statuses['dir/a.txt'] - console.log(status) expect(repo.isStatusModified(status)).toBe true expect(repo.isStatusNew(status)).toBe false diff --git a/src/git.coffee b/src/git.coffee deleted file mode 100644 index 1cff583f..00000000 --- a/src/git.coffee +++ /dev/null @@ -1,231 +0,0 @@ -path = require 'path' -fs = require 'fs-plus' -{Repository} = require '../build/Release/git.node' - -statusIndexNew = 1 << 0 -statusIndexModified = 1 << 1 -statusIndexDeleted = 1 << 2 -statusIndexRenamed = 1 << 3 -statusIndexTypeChange = 1 << 4 -statusWorkingDirNew = 1 << 7 -statusWorkingDirModified = 1 << 8 -statusWorkingDirDelete = 1 << 9 -statusWorkingDirTypeChange = 1 << 10 -statusIgnored = 1 << 14 - -modifiedStatusFlags = statusWorkingDirModified | statusIndexModified | - statusWorkingDirDelete | statusIndexDeleted | - statusWorkingDirTypeChange | statusIndexTypeChange - -newStatusFlags = statusWorkingDirNew | statusIndexNew - -deletedStatusFlags = statusWorkingDirDelete | statusIndexDeleted - -indexStatusFlags = statusIndexNew | statusIndexModified | - statusIndexDeleted | statusIndexRenamed | - statusIndexTypeChange - -Repository::release = -> - submoduleRepo?.release() for submodulePath, submoduleRepo of @submodules - @_release() - -Repository::getWorkingDirectory = -> - @workingDirectory ?= @_getWorkingDirectory()?.replace(/\/$/, '') - -Repository::getShortHead = -> - head = @getHead() - return head unless head? - return head.substring(11) if head.indexOf('refs/heads/') is 0 - return head.substring(10) if head.indexOf('refs/tags/') is 0 - return head.substring(13) if head.indexOf('refs/remotes/') is 0 - return head.substring(0, 7) if head.match(/[a-fA-F0-9]{40}/) - return head - -Repository::isStatusModified = (status=0) -> - (status & modifiedStatusFlags) > 0 - -Repository::isPathModified = (path) -> - @isStatusModified(@getStatus(path)) - -Repository::isStatusNew = (status=0) -> - (status & newStatusFlags) > 0 - -Repository::isPathNew = (path) -> - @isStatusNew(@getStatus(path)) - -Repository::isStatusDeleted = (status=0) -> - (status & deletedStatusFlags) > 0 - -Repository::isPathDeleted = (path) -> - @isStatusDeleted(@getStatus(path)) - -Repository::isPathStaged = (path) -> - @isStatusStaged(@getStatus(path)) - -Repository::isStatusIgnored = (status=0) -> - (status & statusIgnored) > 0 - -Repository::isStatusStaged = (status=0) -> - (status & indexStatusFlags) > 0 - -Repository::getUpstreamBranch = (branch) -> - branch ?= @getHead() - return null unless branch?.length > 11 - return null unless branch.indexOf('refs/heads/') is 0 - - shortBranch = branch.substring(11) - - branchMerge = @getConfigValue("branch.#{shortBranch}.merge") - return null unless branchMerge?.length > 11 - return null unless branchMerge.indexOf('refs/heads/') is 0 - - branchRemote = @getConfigValue("branch.#{shortBranch}.remote") - return null unless branchRemote?.length > 0 - - "refs/remotes/#{branchRemote}/#{branchMerge.substring(11)}" - -Repository::getAheadBehindCount = (branch='HEAD')-> - if branch isnt 'HEAD' and branch.indexOf('refs/heads/') isnt 0 - branch = "refs/heads/#{branch}" - - counts = - ahead: 0 - behind: 0 - headCommit = @getReferenceTarget(branch) - return counts unless headCommit?.length > 0 - - upstream = @getUpstreamBranch() - return counts unless upstream?.length > 0 - upstreamCommit = @getReferenceTarget(upstream) - return counts unless upstreamCommit?.length > 0 - - mergeBase = @getMergeBase(headCommit, upstreamCommit) - return counts unless mergeBase?.length > 0 - - counts.ahead = @getCommitCount(headCommit, mergeBase) - counts.behind = @getCommitCount(upstreamCommit, mergeBase) - counts - -Repository::checkoutReference = (branch, create)-> - if branch.indexOf('refs/heads/') isnt 0 - branch = "refs/heads/#{branch}" - - @checkoutRef(branch, create) - -Repository::relativize = (path) -> - return path unless path - - if process.platform is 'win32' - path = path.replace(/\\/g, '/') - else - return path unless path[0] is '/' - - if @caseInsensitiveFs - lowerCasePath = path.toLowerCase() - - workingDirectory = @getWorkingDirectory() - if workingDirectory - workingDirectory = workingDirectory.toLowerCase() - if lowerCasePath.indexOf("#{workingDirectory}/") is 0 - return path.substring(workingDirectory.length + 1) - else if lowerCasePath is workingDirectory - return '' - - if @openedWorkingDirectory - workingDirectory = @openedWorkingDirectory.toLowerCase() - if lowerCasePath.indexOf("#{workingDirectory}/") is 0 - return path.substring(workingDirectory.length + 1) - else if lowerCasePath is workingDirectory - return '' - else - workingDirectory = @getWorkingDirectory() - if workingDirectory - if path.indexOf("#{workingDirectory}/") is 0 - return path.substring(workingDirectory.length + 1) - else if path is workingDirectory - return '' - - if @openedWorkingDirectory - if path.indexOf("#{@openedWorkingDirectory}/") is 0 - return path.substring(@openedWorkingDirectory.length + 1) - else if path is @openedWorkingDirectory - return '' - - path - -Repository::submoduleForPath = (path) -> - path = @relativize(path) - return null unless path - - for submodulePath, submoduleRepo of @submodules - if path is submodulePath - return submoduleRepo - else if path.indexOf("#{submodulePath}/") is 0 - # Handle submodules inside of submodules - path = path.substring(submodulePath.length + 1) - return submoduleRepo.submoduleForPath(path) ? submoduleRepo - - null - -Repository::isWorkingDirectory = (path) -> - return false unless path - - if process.platform is 'win32' - path = path.replace(/\\/g, '/') - else - return false unless path[0] is '/' - - if @caseInsensitiveFs - lowerCasePath = path.toLowerCase() - return true if lowerCasePath is @getWorkingDirectory()?.toLowerCase() - return true if lowerCasePath is @openedWorkingDirectory?.toLowerCase() - else - return true if path is @getWorkingDirectory() - return true if path is @openedWorkingDirectory - - false - -realpath = (unrealPath) -> - try - fs.realpathSync(unrealPath) - catch e - unrealPath - -isRootPath = (repositoryPath) -> - if process.platform is 'win32' - /^[a-zA-Z]+:[\\\/]$/.test(repositoryPath) - else - repositoryPath is path.sep - -openRepository = (repositoryPath, search = true) -> - symlink = realpath(repositoryPath) isnt repositoryPath - repositoryPath = repositoryPath.replace(/\\/g, '/') if process.platform is 'win32' - repository = new Repository(repositoryPath, search) - if repository.exists() - repository.caseInsensitiveFs = fs.isCaseInsensitive() - if symlink - workingDirectory = repository.getWorkingDirectory() - while not isRootPath(repositoryPath) - if realpath(repositoryPath) is workingDirectory - repository.openedWorkingDirectory = repositoryPath - break - repositoryPath = path.resolve(repositoryPath, '..') - repository - else - null - -openSubmodules = (repository) -> - repository.submodules = {} - for relativePath in repository.getSubmodulePaths() when relativePath - submodulePath = path.join(repository.getWorkingDirectory(), relativePath) - if submoduleRepo = openRepository(submodulePath) - if submoduleRepo.getPath() is repository.getPath() - submoduleRepo.release() - else - openSubmodules(submoduleRepo) - repository.submodules[relativePath] = submoduleRepo - -exports.open = (repositoryPath, search = true) -> - repository = openRepository(repositoryPath, search) - openSubmodules(repository) if repository? - repository diff --git a/src/git.js b/src/git.js new file mode 100644 index 00000000..980ad41a --- /dev/null +++ b/src/git.js @@ -0,0 +1,292 @@ +const path = require('path') +const fs = require('fs-plus') +const {Repository} = require('../build/Release/git.node') + +const statusIndexNew = 1 << 0 +const statusIndexModified = 1 << 1 +const statusIndexDeleted = 1 << 2 +const statusIndexRenamed = 1 << 3 +const statusIndexTypeChange = 1 << 4 +const statusWorkingDirNew = 1 << 7 +const statusWorkingDirModified = 1 << 8 +const statusWorkingDirDelete = 1 << 9 +const statusWorkingDirTypeChange = 1 << 10 +const statusIgnored = 1 << 14 + +const modifiedStatusFlags = + statusWorkingDirModified | + statusIndexModified | + statusWorkingDirDelete | + statusIndexDeleted | + statusWorkingDirTypeChange | + statusIndexTypeChange + +const newStatusFlags = statusWorkingDirNew | statusIndexNew + +const deletedStatusFlags = statusWorkingDirDelete | statusIndexDeleted + +const indexStatusFlags = + statusIndexNew | + statusIndexModified | + statusIndexDeleted | + statusIndexRenamed | + statusIndexTypeChange + +Repository.prototype.release = function () { + for (let submodulePath in this.submodules) { + const submoduleRepo = this.submodules[submodulePath] + if (submoduleRepo) submoduleRepo.release() + } + return this._release() +} + +Repository.prototype.getWorkingDirectory = function () { + if (!this.workingDirectory) { + this.workingDirectory = this._getWorkingDirectory() + if (this.workingDirectory) this.workingDirectory = this.workingDirectory.replace(/\/$/, '') + } + return this.workingDirectory +} + +Repository.prototype.getShortHead = function () { + const head = this.getHead() + if (head == null) return head + if (head.startsWith('refs/heads/')) return head.substring(11) + if (head.startsWith('refs/tags/')) return head.substring(10) + if (head.startsWith('refs/remotes/')) return head.substring(13) + if (head.match(/[a-fA-F0-9]{40}/)) return head.substring(0, 7) + return head +} + +Repository.prototype.isStatusModified = function (status = 0) { + return (status & modifiedStatusFlags) > 0 +} + +Repository.prototype.isPathModified = function (path) { + return this.isStatusModified(this.getStatus(path)) +} + +Repository.prototype.isStatusNew = function (status = 0) { + return (status & newStatusFlags) > 0 +} + +Repository.prototype.isPathNew = function (path) { + return this.isStatusNew(this.getStatus(path)) +} + +Repository.prototype.isStatusDeleted = function (status = 0) { + return (status & deletedStatusFlags) > 0 +} + +Repository.prototype.isPathDeleted = function (path) { + return this.isStatusDeleted(this.getStatus(path)) +} + +Repository.prototype.isPathStaged = function (path) { + return this.isStatusStaged(this.getStatus(path)) +} + +Repository.prototype.isStatusIgnored = function (status = 0) { + return (status & statusIgnored) > 0 +} + +Repository.prototype.isStatusStaged = function (status = 0) { + return (status & indexStatusFlags) > 0 +} + +Repository.prototype.getUpstreamBranch = function (branch) { + if (branch == null) branch = this.getHead() + if (!branch || !branch.startsWith('refs/heads/')) return null + const shortBranch = branch.substring(11) + + const branchMerge = this.getConfigValue(`branch.${shortBranch}.merge`) + if (!branchMerge || !branchMerge.startsWith('refs/heads/')) return null + const shortBranchMerge = branchMerge.substring(11) + + const branchRemote = this.getConfigValue(`branch.${shortBranch}.remote`) + if (!branch || branch.length === 0) return null + + return `refs/remotes/${branchRemote}/${shortBranchMerge}` +} + +Repository.prototype.getAheadBehindCount = function (branch = 'HEAD') { + if (branch !== 'HEAD' && !branch.startsWith('refs/heads/')) { + branch = `refs/heads/${branch}` + } + + const counts = {ahead: 0, behind: 0} + const headCommit = this.getReferenceTarget(branch) + if (!headCommit || headCommit.length === 0) return counts + + const upstream = this.getUpstreamBranch() + if (!upstream || upstream.length === 0) return counts + const upstreamCommit = this.getReferenceTarget(upstream) + if (!upstreamCommit || upstreamCommit.length === 0) return counts + + const mergeBase = this.getMergeBase(headCommit, upstreamCommit) + if (!mergeBase || mergeBase.length === 0) return counts + + counts.ahead = this.getCommitCount(headCommit, mergeBase) + counts.behind = this.getCommitCount(upstreamCommit, mergeBase) + return counts +} + +Repository.prototype.checkoutReference = function (branch, create) { + if (branch.indexOf('refs/heads/') !== 0) branch = `refs/heads/${branch}` + return this.checkoutRef(branch, create) +} + +Repository.prototype.relativize = function (path) { + let workingDirectory + if (!path) return path + + if (process.platform === 'win32') { + path = path.replace(/\\/g, '/') + } else { + if (path[0] !== '/') return path + } + + if (this.caseInsensitiveFs) { + const lowerCasePath = path.toLowerCase() + + workingDirectory = this.getWorkingDirectory() + if (workingDirectory) { + workingDirectory = workingDirectory.toLowerCase() + if (lowerCasePath.startsWith(`${workingDirectory}/`)) { + return path.substring(workingDirectory.length + 1) + } else if (lowerCasePath === workingDirectory) { + return '' + } + } + + if (this.openedWorkingDirectory) { + workingDirectory = this.openedWorkingDirectory.toLowerCase() + if (lowerCasePath.startsWith(`${workingDirectory}/`)) { + return path.substring(workingDirectory.length + 1) + } else if (lowerCasePath === workingDirectory) { + return '' + } + } + } else { + workingDirectory = this.getWorkingDirectory() + if (workingDirectory) { + if (path.startsWith(`${workingDirectory}/`)) { + return path.substring(workingDirectory.length + 1) + } else if (path === workingDirectory) { + return '' + } + } + + if (this.openedWorkingDirectory) { + if (path.startsWith(`${this.openedWorkingDirectory}/`)) { + return path.substring(this.openedWorkingDirectory.length + 1) + } else if (path === this.openedWorkingDirectory) { + return '' + } + } + } + + return path +} + +Repository.prototype.submoduleForPath = function (path) { + path = this.relativize(path) + if (!path) return null + + for (let submodulePath in this.submodules) { + const submoduleRepo = this.submodules[submodulePath] + if (path === submodulePath) { + return submoduleRepo + } else if (path.startsWith(`${submodulePath}/`)) { + path = path.substring(submodulePath.length + 1) + return submoduleRepo.submoduleForPath(path) || submoduleRepo + } + } + + return null +} + +Repository.prototype.isWorkingDirectory = function (path) { + if (!path) return false + + if (process.platform === 'win32') { + path = path.replace(/\\/g, '/') + } else { + if (path[0] !== '/') return false + } + + if (this.caseInsensitiveFs) { + const lowerCasePath = path.toLowerCase() + const workingDirectory = this.getWorkingDirectory() + if (workingDirectory && workingDirectory.toLowerCase() === lowerCasePath) return true + if (this.openedWorkingDirectory && this.openedWorkingDirectory.toLowerCase() === lowerCasePath) return true + } else { + return path === this.getWorkingDirectory() || path === this.openedWorkingDirectory + } + + return false +} + +function realpath (unrealPath) { + try { + return fs.realpathSync(unrealPath) + } catch (e) { + return unrealPath + } +} + +function isRootPath (repositoryPath) { + if (process.platform === 'win32') { + return /^[a-zA-Z]+:[\\/]$/.test(repositoryPath) + } else { + return repositoryPath === path.sep + } +} + +function openRepository (repositoryPath, search) { + const symlink = realpath(repositoryPath) !== repositoryPath + + if (process.platform === 'win32') repositoryPath = repositoryPath.replace(/\\/g, '/') + const repository = new Repository(repositoryPath, search) + if (repository.exists()) { + repository.caseInsensitiveFs = fs.isCaseInsensitive() + if (symlink) { + const workingDirectory = repository.getWorkingDirectory() + while (!isRootPath(repositoryPath)) { + if (realpath(repositoryPath) === workingDirectory) { + repository.openedWorkingDirectory = repositoryPath + break + } + repositoryPath = path.resolve(repositoryPath, '..') + } + } + return repository + } else { + return null + } +} + +function openSubmodules (repository) { + repository.submodules = {} + + for (let relativePath of repository.getSubmodulePaths()) { + if (relativePath) { + const submodulePath = path.join(repository.getWorkingDirectory(), relativePath) + const submoduleRepo = openRepository(submodulePath) + if (submoduleRepo) { + if (submoduleRepo.getPath() === repository.getPath()) { + submoduleRepo.release() + } else { + openSubmodules(submoduleRepo) + repository.submodules[relativePath] = submoduleRepo + } + } + } + } +} + +exports.open = function (repositoryPath, search = true) { + const repository = openRepository(repositoryPath, search) + if (repository) openSubmodules(repository) + return repository +} From 933f04f2d523a84c2651bc1514ce4beb4c0b7eaf Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 25 Sep 2017 17:03:22 -0700 Subject: [PATCH 129/194] Convert test to JS --- package.json | 2 +- spec/git-spec.coffee | 774 ------------------------------------ spec/git-spec.js | 927 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 928 insertions(+), 775 deletions(-) delete mode 100644 spec/git-spec.coffee create mode 100644 spec/git-spec.js diff --git a/package.json b/package.json index d8e6cbe4..5e332cef 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,6 @@ }, "scripts": { "prepublish": "standard src spec", - "test": "jasmine-focused --captureExceptions --coffee spec" + "test": "jasmine-focused --captureExceptions spec" } } diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee deleted file mode 100644 index 5aba0142..00000000 --- a/spec/git-spec.coffee +++ /dev/null @@ -1,774 +0,0 @@ -git = require '../src/git' -path = require 'path' -fs = require 'fs-plus' -{exec} = require 'child_process' -wrench = require 'wrench' -temp = require 'temp' -_ = require 'underscore' - -execCommands = (commands, callback) -> - if process.platform is 'win32' - command = commands.join(' & ') - else - command = commands.join(' && ') - exec(command, callback) - -describe "git", -> - repo = null - - afterEach -> - repo?.release() - - describe ".open(path)", -> - describe "when the path is a repository", -> - it "returns a repository", -> - expect(git.open(__dirname)).not.toBeNull() - - describe "when the path isn't a repository", -> - it "returns null", -> - expect(git.open('/tmp/path/does/not/exist')).toBeNull() - - describe "when limiting upwards traversal", -> - it "returns null", -> - repositorySubdirectoryPath = path.join(path.dirname(__dirname), 'spec', 'fixtures') - expect(git.open(repositorySubdirectoryPath, false)).toBeNull() - - describe ".getPath()", -> - it "returns the path to the .git directory", -> - repositoryPath = git.open(__dirname).getPath() - currentGitPath = path.join(path.dirname(__dirname), '.git/') - currentGitPath = currentGitPath.replace(/\\/g, '/') if process.platform is 'win32' - expect(repositoryPath).toBe currentGitPath - - describe ".getWorkingDirectory()", -> - it "returns the path to the working directory", -> - workingDirectory = git.open(__dirname).getWorkingDirectory() - cwd = path.dirname(__dirname) - cwd = cwd.replace(/\\/g, '/') if process.platform is 'win32' - expect(workingDirectory).toBe cwd - - describe ".getHead()", -> - describe "when a branch is checked out", -> - it "returns the branch's full path", -> - repo = git.open(path.join(__dirname, 'fixtures/master.git')) - expect(repo.getHead()).toBe 'refs/heads/master' - - describe "when the HEAD is detached", -> - it "return the SHA-1 that is checked out", -> - repo = git.open(path.join(__dirname, 'fixtures/detached.git')) - expect(repo.getHead()).toBe '50719ab369dcbbc2fb3b7a0167c52accbd0eb40e' - - describe ".getShortHead()", -> - describe "when a branch is checked out", -> - it "returns the branch's name", -> - repo = git.open(path.join(__dirname, 'fixtures/master.git')) - expect(repo.getShortHead()).toBe 'master' - - describe "when the HEAD is detached", -> - it "return the abbreviated SHA-1 that is checked out", -> - repo = git.open(path.join(__dirname, 'fixtures/detached.git')) - expect(repo.getShortHead()).toBe '50719ab' - - describe ".isIgnored(path)", -> - [ignoreRepoRoot, ignoreRepoDir] = [] - - beforeEach -> - # this setup should be done in beforeAll, but jasmine 1.x doesn't have it. - ignoreRepoRoot = temp.mkdirSync("ignore-dir") - ignoreRepoDir = path.join(ignoreRepoRoot, "ignored") - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/ignored-workspace/'), ignoreRepoDir) - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/ignored.git'), path.join(ignoreRepoDir, '.git')) - - afterEach -> - wrench.rmdirSyncRecursive(ignoreRepoRoot) - - describe "when the path is undefined", -> - it "return false", -> - repo = git.open(ignoreRepoDir) - expect(repo.isIgnored()).toBe false - - describe "when the path is ignored", -> - it "returns true", -> - repo = git.open(ignoreRepoDir) - expect(repo.isIgnored('a.txt')).toBe true - expect(repo.isIgnored('subdir/subdir')).toBe true - - describe "when the path is not ignored", -> - it "return false", -> - repo = git.open(ignoreRepoDir) - expect(repo.isIgnored('b.txt')).toBe false - expect(repo.isIgnored('subdir')).toBe false - expect(repo.isIgnored('subdir/yak.txt')).toBe false - - describe ".isSubmodule(path)", -> - describe "when the path is undefined", -> - it "return false", -> - repo = git.open(path.join(__dirname, 'fixtures/submodule.git')) - expect(repo.isSubmodule()).toBe false - - describe "when the path is a submodule", -> - it "returns true", -> - repo = git.open(path.join(__dirname, 'fixtures/submodule.git')) - expect(repo.isSubmodule('a')).toBe true - - describe "when the path is not a submodule", -> - it "return false", -> - repo = git.open(path.join(__dirname, 'fixtures/submodule.git')) - expect(repo.isSubmodule('b')).toBe false - - describe ".getConfigValue(key)", -> - it "returns the value for the key", -> - repo = git.open(path.join(__dirname, 'fixtures/master.git')) - expect(repo.getConfigValue("core.repositoryformatversion")).toBe '0' - expect(repo.getConfigValue("core.ignorecase")).toBe 'true' - expect(repo.getConfigValue("not.section")).toBe null - - describe ".setConfigValue(key, value)", -> - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - it "sets the key to the value in the config", -> - expect(repo.setConfigValue()).toBe false - expect(repo.setConfigValue('1')).toBe false - expect(repo.setConfigValue('a.b', 'test')).toBe true - expect(repo.getConfigValue('a.b')).toBe 'test' - expect(repo.setConfigValue('a.b.c', 'foo')).toBe true - expect(repo.getConfigValue('a.b.c')).toBe 'foo' - - describe '.isPathModified(path)', -> - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - describe 'when a path is deleted', -> - it 'returns true', -> - expect(repo.isPathModified('a.txt')).toBe true - - describe 'when a path is modified', -> - it 'returns true', -> - fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'a.txt'), 'changing a.txt', 'utf8') - expect(repo.isPathModified('a.txt')).toBe true - - describe 'when a path is new', -> - it 'returns false', -> - fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new.txt'), 'new', 'utf8') - expect(repo.isPathModified('new.txt')).toBe false - - describe '.isPathDeleted(path)', -> - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - describe 'when a path is deleted', -> - it 'returns true', -> - expect(repo.isPathDeleted('a.txt')).toBe true - - describe 'when a path is modified', -> - it 'returns false', -> - fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'a.txt'), 'changing a.txt', 'utf8') - expect(repo.isPathDeleted('a.txt')).toBe false - - describe 'when a path is new', -> - it 'returns false', -> - fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new.txt'), 'new', 'utf8') - expect(repo.isPathDeleted('new.txt')).toBe false - - describe '.isPathNew(path)', -> - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - describe 'when a path is deleted', -> - it 'returns false', -> - expect(repo.isPathNew('a.txt')).toBe false - - describe 'when a path is modified', -> - it 'returns false', -> - fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'a.txt'), 'changing a.txt', 'utf8') - expect(repo.isPathNew('a.txt')).toBe false - - describe 'when a path is new', -> - it 'returns true', -> - fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new.txt'), 'new', 'utf8') - expect(repo.isPathNew('new.txt')).toBe true - - describe 'isPathStaged(path)', -> - [repoDirectory] = [] - - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - describe 'when a path is new and staged', -> - it 'returns true ', -> - fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new.txt'), 'new', 'utf8') - expect(repo.isPathStaged('new.txt')).toBe false - repo.add('new.txt') - expect(repo.isPathStaged('new.txt')).toBe true - - describe 'when a path is modified and staged', -> - it 'returns true ', -> - fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'a.txt'), 'changing a.txt', 'utf8') - expect(repo.isPathStaged('a.txt')).toBe false - repo.add('a.txt') - expect(repo.isPathStaged('a.txt')).toBe true - - describe 'when a path is deleted and staged', -> - it 'returns true ', -> - expect(repo.isPathStaged('a.txt')).toBe false - gitCommandHandler = jasmine.createSpy('gitCommandHandler') - execCommands ["cd #{repoDirectory}", "git rm -f a.txt"], gitCommandHandler - - waitsFor -> - gitCommandHandler.callCount is 1 - - runs -> - expect(repo.isPathStaged('a.txt')).toBe true - - describe '.isStatusIgnored(status)', -> - it 'returns true when the status is ignored, false otherwise', -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/ignored.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - ignoreFile = path.join(repo.getWorkingDirectory(), '.git/info/exclude') - fs.writeFileSync(ignoreFile, 'c.txt') - fs.writeFileSync(path.join(repoDirectory, 'c.txt'), '') - - expect(repo.isStatusIgnored(repo.getStatus('c.txt'))).toBe true - expect(repo.isStatusIgnored(repo.getStatus('b.txt'))).toBe false - expect(repo.isStatusIgnored()).toBe false - - describe '.getUpstreamBranch()', -> - describe 'when no upstream branch exists', -> - it 'returns null', -> - repo = git.open(path.join(__dirname, 'fixtures/master.git')) - expect(repo.getUpstreamBranch()).toBe null - - describe 'when an upstream branch exists', -> - it 'returns the full path to the branch', -> - repo = git.open(path.join(__dirname, 'fixtures/upstream.git')) - expect(repo.getUpstreamBranch()).toBe 'refs/remotes/origin/master' - - describe '.checkoutReference(reference, [create])', -> - repoDirectory = null - - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/references.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - expect(repo.getHead()).toBe 'refs/heads/master' - - describe 'when a local reference exists', -> - it 'checks a branch out if passed a short reference', -> - expect(repo.checkoutReference('getHeadOriginal')).toBe true - expect(repo.getHead()).toBe 'refs/heads/getHeadOriginal' - - it 'checks a branch out if passed a long reference', -> - expect(repo.checkoutReference('refs/heads/getHeadOriginal')).toBe true - expect(repo.getHead()).toBe 'refs/heads/getHeadOriginal' - - # in this test, we need to fake a commit and try to switch to a new branch - it 'does not check a branch out if the dirty tree interferes', -> - fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'README.md'), 'great words', 'utf8') - gitCommandHandler = jasmine.createSpy('gitCommandHandler') - execCommands ["cd #{repoDirectory}", "git add .", "git commit -m 'comitting'"], gitCommandHandler - - waitsFor -> - gitCommandHandler.callCount is 1 - - runs -> - expect(repo.checkoutReference('refs/heads/getHeadOriginal')).toBe true - fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'README.md'), 'more words', 'utf8') - expect(repo.checkoutReference('refs/heads/master')).toBe false - expect(repo.getHead()).toBe 'refs/heads/getHeadOriginal' - - it 'does check a branch out if the dirty tree does not interfere', -> - fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new_file.md'), 'a new file', 'utf8') - expect(repo.checkoutReference('refs/heads/getHeadOriginal')).toBe true - - describe 'when a local reference doesn\'t exist', -> - it 'does nothing if branch creation was not specified', -> - expect(repo.checkoutReference('refs/heads/whoop-whoop')).toBe false - - it 'creates the new branch (if asked to)', -> - expect(repo.checkoutReference('refs/heads/whoop-whoop', true)).toBe true - expect(repo.getHead()).toBe 'refs/heads/whoop-whoop' - - it 'does nothing if the new branch is malformed (even if asked to)', -> - expect(repo.checkoutReference('refs/heads/inv@{id', true)).toBe false - expect(repo.getHead()).toBe 'refs/heads/master' - - describe 'when a short reference is passed', -> - it 'does nothing if branch creation was not specified', -> - expect(repo.checkoutReference('bananas')).toBe false - - it 'creates the new branch (if asked to)', -> - expect(repo.checkoutReference('bananas', true)).toBe true - expect(repo.getHead()).toBe 'refs/heads/bananas' - - describe '.checkoutHead(path)', -> - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - describe 'when the path exists', -> - it 'replaces the file contents with the HEAD revision and returns true', -> - filePath = path.join(repo.getWorkingDirectory(), 'a.txt') - fs.writeFileSync(filePath, 'changing a.txt', 'utf8') - expect(repo.checkoutHead('a.txt')).toBe true - lineEnding = if process.platform is 'win32' then '\r\n' else '\n' - expect(fs.readFileSync(filePath, 'utf8')).toBe "first line#{lineEnding}" - - describe 'when the path is undefined', -> - it 'returns false', -> - expect(repo.checkoutHead()).toBe false - - describe '.getReferences()', -> - it 'returns a list of all the references', -> - referencesObj = - heads: [ 'refs/heads/diff-lines', 'refs/heads/getHeadOriginal', 'refs/heads/master' ] - remotes: [ 'refs/remotes/origin/getHeadOriginal', 'refs/remotes/origin/HEAD', 'refs/remotes/origin/master', 'refs/remotes/upstream/HEAD', 'refs/remotes/upstream/master' ] - tags: [ 'refs/tags/v1.0', 'refs/tags/v2.0' ] - - repo = git.open(path.join(__dirname, 'fixtures/references.git')) - expect(repo.getReferences()).toEqual referencesObj - - describe '.getReferenceTarget(branch)', -> - it 'returns the SHA-1 for a reference', -> - repo = git.open(path.join(__dirname, 'fixtures/master.git')) - expect(repo.getReferenceTarget('HEAD2')).toBe null - expect(repo.getReferenceTarget('HEAD')).toBe 'b2c96bdffe1a8f239c2d450863e4a6caa6dcb655' - expect(repo.getReferenceTarget('refs/heads/master')).toBe 'b2c96bdffe1a8f239c2d450863e4a6caa6dcb655' - - describe '.getDiffStats(path)', -> - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - describe 'when the path is deleted', -> - it 'returns of number of lines deleted', -> - expect(repo.getDiffStats('a.txt')).toEqual {added: 0, deleted: 1} - describe 'when the path is modified', -> - it 'returns the number of lines added and deleted', -> - filePath = path.join(repo.getWorkingDirectory(), 'a.txt') - fs.writeFileSync(filePath, 'changing\na.txt', 'utf8') - expect(repo.getDiffStats('a.txt')).toEqual {added: 2, deleted: 1} - - describe 'when the path is new', -> - it 'returns that no lines were added or deleted', -> - filePath = path.join(repo.getWorkingDirectory(), 'b.txt') - fs.writeFileSync(filePath, 'changing\nb.txt\nwith lines', 'utf8') - expect(repo.getDiffStats('b.txt')).toEqual {added: 0, deleted: 0} - - describe 'when the repository has no HEAD', -> - it 'returns that no lines were added and deleted', -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - fs.unlinkSync(path.join(repoDirectory, '.git/HEAD')) - expect(repo.getDiffStats('b.txt')).toEqual {added: 0, deleted: 0} - - describe '.getHeadBlob(path)', -> - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - describe 'when the path is modified', -> - it 'returns the HEAD blob contents', -> - filePath = path.join(repo.getWorkingDirectory(), 'a.txt') - fs.writeFileSync(filePath, 'changing\na.txt', 'utf8') - expect(repo.getHeadBlob('a.txt')).toBe 'first line\n' - - describe 'when the path is not modified', -> - it 'returns the HEAD blob contents', -> - expect(repo.getHeadBlob('a.txt')).toBe 'first line\n' - - describe 'when the path does not exist', -> - it 'returns null', -> - expect(repo.getHeadBlob('i-do-not-exist.txt')).toBeNull() - - describe '.getIndexBlob(path)', -> - [repo, repoDirectory] = [] - - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - describe 'when the path is staged', -> - it 'returns the index blob contents', -> - expect(repo.getIndexBlob('a.txt')).toBe 'first line\n' - - filePath = path.join(repo.getWorkingDirectory(), 'a.txt') - fs.writeFileSync(filePath, 'changing\na.txt', 'utf8') - expect(repo.getIndexBlob('a.txt')).toBe 'first line\n' - - gitCommandHandler = jasmine.createSpy('gitCommandHandler') - execCommands ["cd #{repoDirectory}", "git add a.txt"], gitCommandHandler - - waitsFor -> - gitCommandHandler.callCount is 1 - - runs -> - expect(repo.getIndexBlob('a.txt')).toBe 'changing\na.txt' - - describe 'when the path is not staged', -> - it 'returns the index blob contents', -> - expect(repo.getIndexBlob('a.txt')).toBe 'first line\n' - - filePath = path.join(repo.getWorkingDirectory(), 'a.txt') - fs.writeFileSync(filePath, 'changing\na.txt', 'utf8') - expect(repo.getIndexBlob('a.txt')).toBe 'first line\n' - - describe 'when the path does not exist', -> - it 'returns null', -> - expect(repo.getIndexBlob('i-do-not-exist.txt')).toBeNull() - - describe '.getStatus([path])', -> - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - newFilePath = path.join(repo.getWorkingDirectory(), 'b.txt') - fs.writeFileSync(newFilePath, '', 'utf8') - - ignoreFile = path.join(repo.getWorkingDirectory(), '.git/info/exclude') - fs.writeFileSync(ignoreFile, 'c.txt', 'utf8') - ignoredFilePath = path.join(repo.getWorkingDirectory(), 'c.txt') - fs.writeFileSync(ignoredFilePath, '', 'utf8') - - describe 'when no path is specified', -> - it 'returns the status of all modified paths', -> - statuses = repo.getStatus() - expect(_.keys(statuses).length).toBe 2 - expect(statuses['a.txt']).toBe 1 << 9 - expect(statuses['b.txt']).toBe 1 << 7 - - describe 'when a path is specified', -> - it 'returns the status of the given path', -> - expect(repo.getStatus('a.txt')).toBe 1 << 9 - - describe '.getStatusForPaths([paths])', -> - repoDirectory = null - filePath = null - - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/subdir.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - dir = path.join(repo.getWorkingDirectory(), 'dir') - filePath = path.join(dir, 'a.txt') - fs.writeFileSync(filePath, 'hey there', 'utf8') - - describe 'when a path is specified', -> - it 'returns the status of only that path', -> - statuses = repo.getStatusForPaths(['dir/**']) - expect(_.keys(statuses).length).toBe 1 - - status = statuses['dir/a.txt'] - expect(repo.isStatusModified(status)).toBe true - expect(repo.isStatusNew(status)).toBe false - - it 'returns the status of only that path2', -> - fs.writeFileSync(filePath, '', 'utf8') - - statuses = repo.getStatusForPaths(['dir/**']) - expect(_.keys(statuses).length).toBe 0 - - describe 'when no path is specified', -> - it 'returns an empty object', -> - statuses = repo.getStatusForPaths() - expect(_.keys(statuses).length).toBe 0 - - describe 'when an empty array is specified', -> - it 'returns an empty object', -> - statuses = repo.getStatusForPaths([]) - expect(_.keys(statuses).length).toBe 0 - - describe 'when an empty string is specified', -> - it 'returns an empty object', -> - statuses = repo.getStatusForPaths(['']) - expect(_.keys(statuses).length).toBe 1 - - describe '.getAheadBehindCount()', -> - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/ahead-behind.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - it 'returns the number of commits ahead of and behind the upstream branch', -> - counts = repo.getAheadBehindCount() - expect(counts).toEqual {ahead: 3, behind: 2} - - counts = repo.getAheadBehindCount('refs/heads/master') - expect(counts).toEqual {ahead: 3, behind: 2} - - counts = repo.getAheadBehindCount('master') - expect(counts).toEqual {ahead: 3, behind: 2} - - counts = repo.getAheadBehindCount('refs/heads/masterblaster') - expect(counts).toEqual {ahead: 0, behind: 0} - - counts = repo.getAheadBehindCount('') - expect(counts).toEqual {ahead: 0, behind: 0} - - describe '.getLineDiffs(path, text, options)', -> - it 'returns all hunks that differ', -> - repo = git.open(path.join(__dirname, 'fixtures/master.git')) - - diffs = repo.getLineDiffs('a.txt', 'first line is different') - expect(diffs.length).toBe 1 - expect(diffs[0].oldStart).toBe 1 - expect(diffs[0].oldLines).toBe 1 - expect(diffs[0].newStart).toBe 1 - expect(diffs[0].newLines).toBe 1 - - diffs = repo.getLineDiffs('a.txt', 'first line\nsecond line') - expect(diffs.length).toBe 1 - expect(diffs[0].oldStart).toBe 1 - expect(diffs[0].oldLines).toBe 0 - expect(diffs[0].newStart).toBe 2 - expect(diffs[0].newLines).toBe 1 - - diffs = repo.getLineDiffs('a.txt', '') - expect(diffs.length).toBe 1 - expect(diffs[0].oldStart).toBe 1 - expect(diffs[0].oldLines).toBe 1 - expect(diffs[0].newStart).toBe 0 - expect(diffs[0].newLines).toBe 0 - - it "returns null for paths that don't exist", -> - repo = git.open(path.join(__dirname, 'fixtures/master.git')) - - diffs = repo.getLineDiffs('i-dont-exists.txt', 'content') - expect(diffs).toBeNull() - - describe "ignoreEolWhitespace option", -> - it "ignores eol of line whitespace changes", -> - repo = git.open(path.join(__dirname, 'fixtures/whitespace.git')) - - diffs = repo.getLineDiffs('file.txt', 'first\r\nsecond\r\nthird\r\n', ignoreEolWhitespace: false) - expect(diffs.length).toBe 1 - - diffs = repo.getLineDiffs('file.txt', 'first\r\nsecond\r\nthird\r\n', ignoreEolWhitespace: true) - expect(diffs.length).toBe 0 - - describe "useIndex options", -> - it "uses the index version instead of the HEAD version for diffs", -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - diffs = repo.getLineDiffs('a.txt', 'first line is different', useIndex: true) - expect(diffs.length).toBe 1 - - filePath = path.join(repo.getWorkingDirectory(), 'a.txt') - fs.writeFileSync(filePath, 'first line is different', 'utf8') - - gitCommandHandler = jasmine.createSpy('gitCommandHandler') - execCommands ["cd #{repoDirectory}", "git add a.txt"], gitCommandHandler - - waitsFor -> - gitCommandHandler.callCount is 1 - - runs -> - diffs = repo.getLineDiffs('a.txt', 'first line is different', useIndex: true) - expect(diffs.length).toBe 0 - - diffs = repo.getLineDiffs('a.txt', 'first line is different', useIndex: false) - expect(diffs.length).toBe 1 - - describe '.getLineDiffDetails(path, text, options)', -> - it 'returns all relevant lines in a diff', -> - repo = git.open(path.join(__dirname, 'fixtures/master.git')) - - isOldLine = (diff) -> - diff.oldLineNumber >= 0 and diff.newLineNumber is -1 - - isNewLine = (diff) -> - diff.oldLineNumber is -1 and diff.newLineNumber >= 0 - - diffs = repo.getLineDiffDetails('a.txt', 'first line is different') - expect(diffs.length).toBe 3 - expect(isOldLine(diffs[0])).toBe true - expect(diffs[0].line).toEqual 'first line\n' - expect(isNewLine(diffs[1])).toBe true - expect(diffs[1].line).toEqual 'first line is different' - - diffs = repo.getLineDiffDetails('a.txt', 'first line\nsecond line') - expect(diffs.length).toBe 2 - expect(isNewLine(diffs[0])).toBe true - expect(diffs[0].line).toEqual 'second line' - - diffs = repo.getLineDiffDetails('a.txt', '') - expect(diffs.length).toBe 1 - expect(isOldLine(diffs[0])).toBe true - expect(diffs[0].line).toEqual 'first line\n' - - it "returns null for paths that don't exist", -> - repo = git.open(path.join(__dirname, 'fixtures/master.git')) - - diffs = repo.getLineDiffDetails('i-dont-exists.txt', 'content') - expect(diffs).toBeNull() - - describe "ignoreEolWhitespace option", -> - it "ignores eol of line whitespace changes", -> - repo = git.open(path.join(__dirname, 'fixtures/whitespace.git')) - - diffs = repo.getLineDiffDetails('file.txt', 'first\r\nsecond\r\nthird\r\n', ignoreEolWhitespace: false) - expect(diffs.length).toBe 6 - - diffs = repo.getLineDiffs('file.txt', 'first\r\nsecond\r\nthird\r\n', ignoreEolWhitespace: true) - expect(diffs.length).toBe 0 - - describe "useIndex options", -> - it "uses the index version instead of the HEAD version for diffs", -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - diffs = repo.getLineDiffDetails('a.txt', 'first line is different', useIndex: true) - expect(diffs.length).toBe 3 - - filePath = path.join(repo.getWorkingDirectory(), 'a.txt') - fs.writeFileSync(filePath, 'first line is different', 'utf8') - - gitCommandHandler = jasmine.createSpy('gitCommandHandler') - execCommands ["cd #{repoDirectory}", "git add a.txt"], gitCommandHandler - - waitsFor -> - gitCommandHandler.callCount is 1 - - runs -> - diffs = repo.getLineDiffDetails('a.txt', 'first line is different', useIndex: true) - expect(diffs.length).toBe 0 - - diffs = repo.getLineDiffDetails('a.txt', 'first line is different', useIndex: false) - expect(diffs.length).toBe 3 - - describe '.relativize(path)', -> - it 'relativizes the given path to the working directory of the repository', -> - repo = git.open(__dirname) - workingDirectory = repo.getWorkingDirectory() - - expect(repo.relativize(path.join(workingDirectory, 'a.txt'))).toBe 'a.txt' - expect(repo.relativize(path.join(workingDirectory, 'a/b/c.txt'))).toBe 'a/b/c.txt' - expect(repo.relativize('a.txt')).toBe 'a.txt' - expect(repo.relativize('/not/in/working/dir')).toBe '/not/in/working/dir' - expect(repo.relativize(null)).toBe null - expect(repo.relativize()).toBeUndefined() - expect(repo.relativize('')).toBe '' - expect(repo.relativize(workingDirectory)).toBe '' - - describe 'when the opened path is a symlink', -> - it 'relativizes against both the linked path and the real path', -> - # Creating symbol link on Windows requires administrator permission so - # we just skip this test. - return if process.platform is 'win32' - - repoDirectory = fs.realpathSync(temp.mkdirSync('node-git-repo-')) - linkDirectory = path.join(fs.realpathSync(temp.mkdirSync('node-git-repo-')), 'link') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - fs.symlinkSync(repoDirectory, linkDirectory) - - repo = git.open(linkDirectory) - expect(repo.relativize(path.join(repoDirectory, 'test1'))).toBe 'test1' - expect(repo.relativize(path.join(linkDirectory, 'test2'))).toBe 'test2' - expect(repo.relativize(path.join(linkDirectory, 'test2/test3'))).toBe 'test2/test3' - expect(repo.relativize('test2/test3')).toBe 'test2/test3' - - it "handles case insensitive filesystems", -> - repoDirectory = temp.mkdirSync('lower-case-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - repo.caseInsensitiveFs = true - workingDirectory = repo.getWorkingDirectory() - - expect(repo.relativize(path.join(workingDirectory.toUpperCase(), 'a.txt'))).toBe 'a.txt' - expect(repo.relativize(path.join(workingDirectory.toUpperCase(), 'a/b/c.txt'))).toBe 'a/b/c.txt' - - linkDirectory = path.join(fs.realpathSync(temp.mkdirSync('lower-case-symlink')), 'link') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - fs.symlinkSync(repoDirectory, linkDirectory) - - repo = git.open(linkDirectory) - repo.caseInsensitiveFs = true - expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2'))).toBe 'test2' - expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2/test3'))).toBe 'test2/test3' - - describe ".isWorkingDirectory(path)", -> - it "returns whether the given path is the repository's working directory", -> - repo = git.open(__dirname) - workingDirectory = repo.getWorkingDirectory() - - expect(repo.isWorkingDirectory(workingDirectory)).toBe true - expect(repo.isWorkingDirectory()).toBe false - expect(repo.isWorkingDirectory(null)).toBe false - expect(repo.isWorkingDirectory('')).toBe false - expect(repo.isWorkingDirectory('test')).toBe false - - repoDirectory = temp.mkdirSync('lower-case-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - repo.caseInsensitiveFs = true - workingDirectory = repo.getWorkingDirectory() - - expect(repo.isWorkingDirectory(workingDirectory.toUpperCase())).toBe true - - describe ".submoduleForPath(path)", -> - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - submoduleDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures', 'master.git'), path.join(repoDirectory, '.git')) - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures', 'master.git'), path.join(submoduleDirectory, '.git')) - - gitCommandHandler = jasmine.createSpy('gitCommandHandler') - execCommands ["cd #{repoDirectory}", "git submodule add #{submoduleDirectory} sub"], gitCommandHandler - - waitsFor -> - gitCommandHandler.callCount is 1 - - runs -> - repo = git.open(repoDirectory) - - it "returns the repository for the path", -> - expect(repo.submoduleForPath()).toBe null - expect(repo.submoduleForPath(null)).toBe null - expect(repo.submoduleForPath('')).toBe null - expect(repo.submoduleForPath('sub1')).toBe null - - submoduleRepoPath = path.join(repo.getPath(), 'modules', 'sub/') - submoduleRepoPath = submoduleRepoPath.replace(/\\/g, '/') if process.platform is 'win32' - - expect(repo.submoduleForPath('sub').getPath()).toBe submoduleRepoPath - expect(repo.submoduleForPath('sub/').getPath()).toBe submoduleRepoPath - expect(repo.submoduleForPath('sub/a').getPath()).toBe submoduleRepoPath - expect(repo.submoduleForPath('sub/a/b/c/d').getPath()).toBe submoduleRepoPath - - describe ".add(path)", -> - beforeEach -> - repoDirectory = temp.mkdirSync('node-git-repo-') - wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) - repo = git.open(repoDirectory) - - filePath = path.join(repoDirectory, 'toadd.txt') - fs.writeFileSync(filePath, 'changes to stage', 'utf8') - - it "introduces the current state of the file to the index", -> - expect(repo.getStatus 'toadd.txt').toBe 1 << 7 - repo.add('toadd.txt') - expect(repo.getStatus 'toadd.txt').toBe 1 << 0 - - it "throws an error if the file doesn't exist", -> - expect(-> repo.add('missing.txt')).toThrow() diff --git a/spec/git-spec.js b/spec/git-spec.js new file mode 100644 index 00000000..52b764b8 --- /dev/null +++ b/spec/git-spec.js @@ -0,0 +1,927 @@ +const git = require('../src/git') +const path = require('path') +const fs = require('fs-plus') +const {exec} = require('child_process') +const wrench = require('wrench') +const temp = require('temp') +const _ = require('underscore') + +describe('git', () => { + let repo + + afterEach(() => { + if (repo) repo.release() + }) + + describe('.open(path)', () => { + describe('when the path is a repository', () => { + it('returns a repository', () => { + expect(git.open(__dirname)).not.toBeNull() + }) + }) + + describe("when the path isn't a repository", () => { + it('returns null', () => { + expect(git.open('/tmp/path/does/not/exist')).toBeNull() + }) + }) + + describe('when limiting upwards traversal', () => { + it('returns null', () => { + const repositorySubdirectoryPath = path.join(path.dirname(__dirname), 'spec', 'fixtures') + expect(git.open(repositorySubdirectoryPath, false)).toBeNull() + }) + }) + }) + + describe('.getPath()', () => { + it('returns the path to the .git directory', () => { + const repositoryPath = git.open(__dirname).getPath() + let currentGitPath = path.join(path.dirname(__dirname), '.git/') + if (process.platform === 'win32') { currentGitPath = currentGitPath.replace(/\\/g, '/') } + expect(repositoryPath).toBe(currentGitPath) + }) + }) + + describe('.getWorkingDirectory()', () => { + it('returns the path to the working directory', () => { + const workingDirectory = git.open(__dirname).getWorkingDirectory() + let cwd = path.dirname(__dirname) + if (process.platform === 'win32') { cwd = cwd.replace(/\\/g, '/') } + expect(workingDirectory).toBe(cwd) + }) + }) + + describe('.getHead()', () => { + describe('when a branch is checked out', () => { + it("returns the branch's full path", () => { + repo = git.open(path.join(__dirname, 'fixtures/master.git')) + expect(repo.getHead()).toBe('refs/heads/master') + }) + }) + + describe('when the HEAD is detached', () => { + it('return the SHA-1 that is checked out', () => { + repo = git.open(path.join(__dirname, 'fixtures/detached.git')) + expect(repo.getHead()).toBe('50719ab369dcbbc2fb3b7a0167c52accbd0eb40e') + }) + }) + }) + + describe('.getShortHead()', () => { + describe('when a branch is checked out', () => { + it("returns the branch's name", () => { + repo = git.open(path.join(__dirname, 'fixtures/master.git')) + expect(repo.getShortHead()).toBe('master') + }) + }) + + describe('when the HEAD is detached', () => { + it('return the abbreviated SHA-1 that is checked out', () => { + repo = git.open(path.join(__dirname, 'fixtures/detached.git')) + expect(repo.getShortHead()).toBe('50719ab') + }) + }) + }) + + describe('.isIgnored(path)', () => { + let ignoreRepoRoot, ignoreRepoDir + + beforeEach(() => { + // this setup should be done in beforeAll, but jasmine 1.x doesn't have it. + ignoreRepoRoot = temp.mkdirSync('ignore-dir') + ignoreRepoDir = path.join(ignoreRepoRoot, 'ignored') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/ignored-workspace/'), ignoreRepoDir) + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/ignored.git'), path.join(ignoreRepoDir, '.git')) + }) + + afterEach(() => wrench.rmdirSyncRecursive(ignoreRepoRoot)) + + describe('when the path is undefined', () => { + it('return false', () => { + repo = git.open(ignoreRepoDir) + expect(repo.isIgnored()).toBe(false) + }) + }) + + describe('when the path is ignored', () => { + it('returns true', () => { + repo = git.open(ignoreRepoDir) + expect(repo.isIgnored('a.txt')).toBe(true) + expect(repo.isIgnored('subdir/subdir')).toBe(true) + }) + }) + + describe('when the path is not ignored', () => { + it('return false', () => { + repo = git.open(ignoreRepoDir) + expect(repo.isIgnored('b.txt')).toBe(false) + expect(repo.isIgnored('subdir')).toBe(false) + expect(repo.isIgnored('subdir/yak.txt')).toBe(false) + }) + }) + }) + + describe('.isSubmodule(path)', () => { + describe('when the path is undefined', () => { + it('return false', () => { + repo = git.open(path.join(__dirname, 'fixtures/submodule.git')) + expect(repo.isSubmodule()).toBe(false) + }) + }) + + describe('when the path is a submodule', () => { + it('returns true', () => { + repo = git.open(path.join(__dirname, 'fixtures/submodule.git')) + expect(repo.isSubmodule('a')).toBe(true) + }) + }) + + describe('when the path is not a submodule', () => { + it('return false', () => { + repo = git.open(path.join(__dirname, 'fixtures/submodule.git')) + expect(repo.isSubmodule('b')).toBe(false) + }) + }) + }) + + describe('.getConfigValue(key)', () => { + it('returns the value for the key', () => { + repo = git.open(path.join(__dirname, 'fixtures/master.git')) + expect(repo.getConfigValue('core.repositoryformatversion')).toBe('0') + expect(repo.getConfigValue('core.ignorecase')).toBe('true') + expect(repo.getConfigValue('not.section')).toBe(null) + }) + }) + + describe('.setConfigValue(key, value)', () => { + beforeEach(() => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + }) + + it('sets the key to the value in the config', () => { + expect(repo.setConfigValue()).toBe(false) + expect(repo.setConfigValue('1')).toBe(false) + expect(repo.setConfigValue('a.b', 'test')).toBe(true) + expect(repo.getConfigValue('a.b')).toBe('test') + expect(repo.setConfigValue('a.b.c', 'foo')).toBe(true) + expect(repo.getConfigValue('a.b.c')).toBe('foo') + }) + }) + + describe('.isPathModified(path)', () => { + beforeEach(() => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + }) + + describe('when a path is deleted', () => { + it('returns true', () => expect(repo.isPathModified('a.txt')).toBe(true)) + }) + + describe('when a path is modified', () => { + it('returns true', () => { + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'a.txt'), 'changing a.txt', 'utf8') + expect(repo.isPathModified('a.txt')).toBe(true) + }) + }) + + describe('when a path is new', () => { + it('returns false', () => { + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new.txt'), 'new', 'utf8') + expect(repo.isPathModified('new.txt')).toBe(false) + }) + }) + }) + + describe('.isPathDeleted(path)', () => { + beforeEach(() => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + }) + + describe('when a path is deleted', () => { + it('returns true', () => expect(repo.isPathDeleted('a.txt')).toBe(true)) + }) + + describe('when a path is modified', () => { + it('returns false', () => { + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'a.txt'), 'changing a.txt', 'utf8') + expect(repo.isPathDeleted('a.txt')).toBe(false) + }) + }) + + describe('when a path is new', () => { + it('returns false', () => { + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new.txt'), 'new', 'utf8') + expect(repo.isPathDeleted('new.txt')).toBe(false) + }) + }) + }) + + describe('.isPathNew(path)', () => { + beforeEach(() => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + }) + + describe('when a path is deleted', () => { + it('returns false', () => expect(repo.isPathNew('a.txt')).toBe(false)) + }) + + describe('when a path is modified', () => { + it('returns false', () => { + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'a.txt'), 'changing a.txt', 'utf8') + expect(repo.isPathNew('a.txt')).toBe(false) + }) + }) + + describe('when a path is new', () => { + it('returns true', () => { + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new.txt'), 'new', 'utf8') + expect(repo.isPathNew('new.txt')).toBe(true) + }) + }) + }) + + describe('isPathStaged(path)', () => { + let repoDirectory + + beforeEach(() => { + repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + }) + + describe('when a path is new and staged', () => { + it('returns true ', () => { + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new.txt'), 'new', 'utf8') + expect(repo.isPathStaged('new.txt')).toBe(false) + repo.add('new.txt') + expect(repo.isPathStaged('new.txt')).toBe(true) + }) + }) + + describe('when a path is modified and staged', () => { + it('returns true ', () => { + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'a.txt'), 'changing a.txt', 'utf8') + expect(repo.isPathStaged('a.txt')).toBe(false) + repo.add('a.txt') + expect(repo.isPathStaged('a.txt')).toBe(true) + }) + }) + + describe('when a path is deleted and staged', () => { + it('returns true ', () => { + expect(repo.isPathStaged('a.txt')).toBe(false) + const gitCommandHandler = jasmine.createSpy('gitCommandHandler') + execCommands([`cd ${repoDirectory}`, 'git rm -f a.txt'], gitCommandHandler) + + waitsFor(() => gitCommandHandler.callCount === 1) + + runs(() => expect(repo.isPathStaged('a.txt')).toBe(true)) + }) + }) + }) + + describe('.isStatusIgnored(status)', () => { + it('returns true when the status is ignored, false otherwise', () => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/ignored.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + const ignoreFile = path.join(repo.getWorkingDirectory(), '.git/info/exclude') + fs.writeFileSync(ignoreFile, 'c.txt') + fs.writeFileSync(path.join(repoDirectory, 'c.txt'), '') + + expect(repo.isStatusIgnored(repo.getStatus('c.txt'))).toBe(true) + expect(repo.isStatusIgnored(repo.getStatus('b.txt'))).toBe(false) + expect(repo.isStatusIgnored()).toBe(false) + }) + }) + + describe('.getUpstreamBranch()', () => { + describe('when no upstream branch exists', () => { + it('returns null', () => { + repo = git.open(path.join(__dirname, 'fixtures/master.git')) + expect(repo.getUpstreamBranch()).toBe(null) + }) + }) + + describe('when an upstream branch exists', () => { + it('returns the full path to the branch', () => { + repo = git.open(path.join(__dirname, 'fixtures/upstream.git')) + expect(repo.getUpstreamBranch()).toBe('refs/remotes/origin/master') + }) + }) + }) + + describe('.checkoutReference(reference, [create])', () => { + let repoDirectory = null + + beforeEach(() => { + repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/references.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + expect(repo.getHead()).toBe('refs/heads/master') + }) + + describe('when a local reference exists', () => { + it('checks a branch out if passed a short reference', () => { + expect(repo.checkoutReference('getHeadOriginal')).toBe(true) + expect(repo.getHead()).toBe('refs/heads/getHeadOriginal') + }) + + it('checks a branch out if passed a long reference', () => { + expect(repo.checkoutReference('refs/heads/getHeadOriginal')).toBe(true) + expect(repo.getHead()).toBe('refs/heads/getHeadOriginal') + }) + + // in this test, we need to fake a commit and try to switch to a new branch + it('does not check a branch out if the dirty tree interferes', () => { + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'README.md'), 'great words', 'utf8') + const gitCommandHandler = jasmine.createSpy('gitCommandHandler') + execCommands([`cd ${repoDirectory}`, 'git add .', "git commit -m 'comitting'"], gitCommandHandler) + + waitsFor(() => gitCommandHandler.callCount === 1) + + runs(() => { + expect(repo.checkoutReference('refs/heads/getHeadOriginal')).toBe(true) + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'README.md'), 'more words', 'utf8') + expect(repo.checkoutReference('refs/heads/master')).toBe(false) + expect(repo.getHead()).toBe('refs/heads/getHeadOriginal') + }) + }) + + it('does check a branch out if the dirty tree does not interfere', () => { + fs.writeFileSync(path.join(repo.getWorkingDirectory(), 'new_file.md'), 'a new file', 'utf8') + expect(repo.checkoutReference('refs/heads/getHeadOriginal')).toBe(true) + }) + }) + + describe('when a local reference doesn\'t exist', () => { + it('does nothing if branch creation was not specified', () => expect(repo.checkoutReference('refs/heads/whoop-whoop')).toBe(false)) + + it('creates the new branch (if asked to)', () => { + expect(repo.checkoutReference('refs/heads/whoop-whoop', true)).toBe(true) + expect(repo.getHead()).toBe('refs/heads/whoop-whoop') + }) + + it('does nothing if the new branch is malformed (even if asked to)', () => { + expect(repo.checkoutReference('refs/heads/inv@{id', true)).toBe(false) + expect(repo.getHead()).toBe('refs/heads/master') + }) + + describe('when a short reference is passed', () => { + it('does nothing if branch creation was not specified', () => expect(repo.checkoutReference('bananas')).toBe(false)) + + it('creates the new branch (if asked to)', () => { + expect(repo.checkoutReference('bananas', true)).toBe(true) + expect(repo.getHead()).toBe('refs/heads/bananas') + }) + }) + }) + }) + + describe('.checkoutHead(path)', () => { + beforeEach(() => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + }) + + describe('when the path exists', () => { + it('replaces the file contents with the HEAD revision and returns true', () => { + const filePath = path.join(repo.getWorkingDirectory(), 'a.txt') + fs.writeFileSync(filePath, 'changing a.txt', 'utf8') + expect(repo.checkoutHead('a.txt')).toBe(true) + const lineEnding = process.platform === 'win32' ? '\r\n' : '\n' + expect(fs.readFileSync(filePath, 'utf8')).toBe(`first line${lineEnding}`) + }) + }) + + describe('when the path is undefined', () => { + it('returns false', () => expect(repo.checkoutHead()).toBe(false)) + }) + }) + + describe('.getReferences()', () => { + it('returns a list of all the references', () => { + const referencesObj = { + heads: [ 'refs/heads/diff-lines', 'refs/heads/getHeadOriginal', 'refs/heads/master' ], + remotes: [ 'refs/remotes/origin/getHeadOriginal', 'refs/remotes/origin/HEAD', 'refs/remotes/origin/master', 'refs/remotes/upstream/HEAD', 'refs/remotes/upstream/master' ], + tags: [ 'refs/tags/v1.0', 'refs/tags/v2.0' ] + } + + repo = git.open(path.join(__dirname, 'fixtures/references.git')) + expect(repo.getReferences()).toEqual(referencesObj) + }) + }) + + describe('.getReferenceTarget(branch)', () => { + it('returns the SHA-1 for a reference', () => { + repo = git.open(path.join(__dirname, 'fixtures/master.git')) + expect(repo.getReferenceTarget('HEAD2')).toBe(null) + expect(repo.getReferenceTarget('HEAD')).toBe('b2c96bdffe1a8f239c2d450863e4a6caa6dcb655') + expect(repo.getReferenceTarget('refs/heads/master')).toBe('b2c96bdffe1a8f239c2d450863e4a6caa6dcb655') + }) + }) + + describe('.getDiffStats(path)', () => { + beforeEach(() => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + }) + + describe('when the path is deleted', () => { + it('returns of number of lines deleted', () => { + expect(repo.getDiffStats('a.txt')).toEqual({added: 0, deleted: 1}) + }) + }) + + describe('when the path is modified', () => { + it('returns the number of lines added and deleted', () => { + const filePath = path.join(repo.getWorkingDirectory(), 'a.txt') + fs.writeFileSync(filePath, 'changing\na.txt', 'utf8') + expect(repo.getDiffStats('a.txt')).toEqual({added: 2, deleted: 1}) + }) + }) + + describe('when the path is new', () => { + it('returns that no lines were added or deleted', () => { + const filePath = path.join(repo.getWorkingDirectory(), 'b.txt') + fs.writeFileSync(filePath, 'changing\nb.txt\nwith lines', 'utf8') + expect(repo.getDiffStats('b.txt')).toEqual({added: 0, deleted: 0}) + }) + }) + + describe('when the repository has no HEAD', () => { + it('returns that no lines were added and deleted', () => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + fs.unlinkSync(path.join(repoDirectory, '.git/HEAD')) + expect(repo.getDiffStats('b.txt')).toEqual({added: 0, deleted: 0}) + }) + }) + }) + + describe('.getHeadBlob(path)', () => { + beforeEach(() => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + }) + + describe('when the path is modified', () => { + it('returns the HEAD blob contents', () => { + const filePath = path.join(repo.getWorkingDirectory(), 'a.txt') + fs.writeFileSync(filePath, 'changing\na.txt', 'utf8') + expect(repo.getHeadBlob('a.txt')).toBe('first line\n') + }) + }) + + describe('when the path is not modified', () => { + it('returns the HEAD blob contents', () => expect(repo.getHeadBlob('a.txt')).toBe('first line\n')) + }) + + describe('when the path does not exist', () => { + it('returns null', () => expect(repo.getHeadBlob('i-do-not-exist.txt')).toBeNull()) + }) + }) + + describe('.getIndexBlob(path)', () => { + let repoDirectory + + beforeEach(() => { + repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + }) + + describe('when the path is staged', () => { + it('returns the index blob contents', () => { + expect(repo.getIndexBlob('a.txt')).toBe('first line\n') + + const filePath = path.join(repo.getWorkingDirectory(), 'a.txt') + fs.writeFileSync(filePath, 'changing\na.txt', 'utf8') + expect(repo.getIndexBlob('a.txt')).toBe('first line\n') + + const gitCommandHandler = jasmine.createSpy('gitCommandHandler') + execCommands([`cd ${repoDirectory}`, 'git add a.txt'], gitCommandHandler) + + waitsFor(() => gitCommandHandler.callCount === 1) + + runs(() => expect(repo.getIndexBlob('a.txt')).toBe('changing\na.txt')) + }) + }) + + describe('when the path is not staged', () => { + it('returns the index blob contents', () => { + expect(repo.getIndexBlob('a.txt')).toBe('first line\n') + + const filePath = path.join(repo.getWorkingDirectory(), 'a.txt') + fs.writeFileSync(filePath, 'changing\na.txt', 'utf8') + expect(repo.getIndexBlob('a.txt')).toBe('first line\n') + }) + }) + + describe('when the path does not exist', () => { + it('returns null', () => expect(repo.getIndexBlob('i-do-not-exist.txt')).toBeNull()) + }) + }) + + describe('.getStatus([path])', () => { + beforeEach(() => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + + const newFilePath = path.join(repo.getWorkingDirectory(), 'b.txt') + fs.writeFileSync(newFilePath, '', 'utf8') + + const ignoreFile = path.join(repo.getWorkingDirectory(), '.git/info/exclude') + fs.writeFileSync(ignoreFile, 'c.txt', 'utf8') + const ignoredFilePath = path.join(repo.getWorkingDirectory(), 'c.txt') + fs.writeFileSync(ignoredFilePath, '', 'utf8') + }) + + describe('when no path is specified', () => { + it('returns the status of all modified paths', () => { + const statuses = repo.getStatus() + expect(_.keys(statuses).length).toBe(2) + expect(statuses['a.txt']).toBe(1 << 9) + expect(statuses['b.txt']).toBe(1 << 7) + }) + }) + + describe('when a path is specified', () => { + it('returns the status of the given path', () => expect(repo.getStatus('a.txt')).toBe(1 << 9)) + }) + }) + + describe('.getStatusForPaths([paths])', () => { + let repoDirectory, filePath + + beforeEach(() => { + repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/subdir.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + + const dir = path.join(repo.getWorkingDirectory(), 'dir') + filePath = path.join(dir, 'a.txt') + fs.writeFileSync(filePath, 'hey there', 'utf8') + }) + + describe('when a path is specified', () => { + it('returns the status of only that path', () => { + const statuses = repo.getStatusForPaths(['dir/**']) + expect(_.keys(statuses).length).toBe(1) + + const status = statuses['dir/a.txt'] + expect(repo.isStatusModified(status)).toBe(true) + expect(repo.isStatusNew(status)).toBe(false) + }) + + it('returns the status of only that path2', () => { + fs.writeFileSync(filePath, '', 'utf8') + + const statuses = repo.getStatusForPaths(['dir/**']) + expect(_.keys(statuses).length).toBe(0) + }) + }) + + describe('when no path is specified', () => { + it('returns an empty object', () => { + const statuses = repo.getStatusForPaths() + expect(_.keys(statuses).length).toBe(0) + }) + }) + + describe('when an empty array is specified', () => { + it('returns an empty object', () => { + const statuses = repo.getStatusForPaths([]) + expect(_.keys(statuses).length).toBe(0) + }) + }) + + describe('when an empty string is specified', () => { + it('returns an empty object', () => { + const statuses = repo.getStatusForPaths(['']) + expect(_.keys(statuses).length).toBe(1) + }) + }) + }) + + describe('.getAheadBehindCount()', () => { + beforeEach(() => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/ahead-behind.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + }) + + it('returns the number of commits ahead of and behind the upstream branch', () => { + let counts = repo.getAheadBehindCount() + expect(counts).toEqual({ahead: 3, behind: 2}) + + counts = repo.getAheadBehindCount('refs/heads/master') + expect(counts).toEqual({ahead: 3, behind: 2}) + + counts = repo.getAheadBehindCount('master') + expect(counts).toEqual({ahead: 3, behind: 2}) + + counts = repo.getAheadBehindCount('refs/heads/masterblaster') + expect(counts).toEqual({ahead: 0, behind: 0}) + + counts = repo.getAheadBehindCount('') + expect(counts).toEqual({ahead: 0, behind: 0}) + }) + }) + + describe('.getLineDiffs(path, text, options)', () => { + it('returns all hunks that differ', () => { + repo = git.open(path.join(__dirname, 'fixtures/master.git')) + + let diffs = repo.getLineDiffs('a.txt', 'first line is different') + expect(diffs.length).toBe(1) + expect(diffs[0].oldStart).toBe(1) + expect(diffs[0].oldLines).toBe(1) + expect(diffs[0].newStart).toBe(1) + expect(diffs[0].newLines).toBe(1) + + diffs = repo.getLineDiffs('a.txt', 'first line\nsecond line') + expect(diffs.length).toBe(1) + expect(diffs[0].oldStart).toBe(1) + expect(diffs[0].oldLines).toBe(0) + expect(diffs[0].newStart).toBe(2) + expect(diffs[0].newLines).toBe(1) + + diffs = repo.getLineDiffs('a.txt', '') + expect(diffs.length).toBe(1) + expect(diffs[0].oldStart).toBe(1) + expect(diffs[0].oldLines).toBe(1) + expect(diffs[0].newStart).toBe(0) + expect(diffs[0].newLines).toBe(0) + }) + + it("returns null for paths that don't exist", () => { + repo = git.open(path.join(__dirname, 'fixtures/master.git')) + + const diffs = repo.getLineDiffs('i-dont-exists.txt', 'content') + expect(diffs).toBeNull() + }) + + describe('ignoreEolWhitespace option', () => { + it('ignores eol of line whitespace changes', () => { + repo = git.open(path.join(__dirname, 'fixtures/whitespace.git')) + + let diffs = repo.getLineDiffs('file.txt', 'first\r\nsecond\r\nthird\r\n', {ignoreEolWhitespace: false}) + expect(diffs.length).toBe(1) + + diffs = repo.getLineDiffs('file.txt', 'first\r\nsecond\r\nthird\r\n', {ignoreEolWhitespace: true}) + expect(diffs.length).toBe(0) + }) + }) + + describe('useIndex options', () => { + it('uses the index version instead of the HEAD version for diffs', () => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + + let diffs = repo.getLineDiffs('a.txt', 'first line is different', {useIndex: true}) + expect(diffs.length).toBe(1) + + const filePath = path.join(repo.getWorkingDirectory(), 'a.txt') + fs.writeFileSync(filePath, 'first line is different', 'utf8') + + const gitCommandHandler = jasmine.createSpy('gitCommandHandler') + execCommands([`cd ${repoDirectory}`, 'git add a.txt'], gitCommandHandler) + + waitsFor(() => gitCommandHandler.callCount === 1) + + runs(() => { + diffs = repo.getLineDiffs('a.txt', 'first line is different', {useIndex: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffs('a.txt', 'first line is different', {useIndex: false}) + expect(diffs.length).toBe(1) + }) + }) + }) + }) + + describe('.getLineDiffDetails(path, text, options)', () => { + it('returns all relevant lines in a diff', () => { + repo = git.open(path.join(__dirname, 'fixtures/master.git')) + + const isOldLine = diff => (diff.oldLineNumber >= 0) && (diff.newLineNumber === -1) + + const isNewLine = diff => (diff.oldLineNumber === -1) && (diff.newLineNumber >= 0) + + let diffs = repo.getLineDiffDetails('a.txt', 'first line is different') + expect(diffs.length).toBe(3) + expect(isOldLine(diffs[0])).toBe(true) + expect(diffs[0].line).toEqual('first line\n') + expect(isNewLine(diffs[1])).toBe(true) + expect(diffs[1].line).toEqual('first line is different') + + diffs = repo.getLineDiffDetails('a.txt', 'first line\nsecond line') + expect(diffs.length).toBe(2) + expect(isNewLine(diffs[0])).toBe(true) + expect(diffs[0].line).toEqual('second line') + + diffs = repo.getLineDiffDetails('a.txt', '') + expect(diffs.length).toBe(1) + expect(isOldLine(diffs[0])).toBe(true) + expect(diffs[0].line).toEqual('first line\n') + }) + + it("returns null for paths that don't exist", () => { + repo = git.open(path.join(__dirname, 'fixtures/master.git')) + + const diffs = repo.getLineDiffDetails('i-dont-exists.txt', 'content') + expect(diffs).toBeNull() + }) + + describe('ignoreEolWhitespace option', () => { + it('ignores eol of line whitespace changes', () => { + repo = git.open(path.join(__dirname, 'fixtures/whitespace.git')) + + let diffs = repo.getLineDiffDetails('file.txt', 'first\r\nsecond\r\nthird\r\n', {ignoreEolWhitespace: false}) + expect(diffs.length).toBe(6) + + diffs = repo.getLineDiffs('file.txt', 'first\r\nsecond\r\nthird\r\n', {ignoreEolWhitespace: true}) + expect(diffs.length).toBe(0) + }) + }) + + describe('useIndex options', () => { + it('uses the index version instead of the HEAD version for diffs', () => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + + let diffs = repo.getLineDiffDetails('a.txt', 'first line is different', {useIndex: true}) + expect(diffs.length).toBe(3) + + const filePath = path.join(repo.getWorkingDirectory(), 'a.txt') + fs.writeFileSync(filePath, 'first line is different', 'utf8') + + const gitCommandHandler = jasmine.createSpy('gitCommandHandler') + execCommands([`cd ${repoDirectory}`, 'git add a.txt'], gitCommandHandler) + + waitsFor(() => gitCommandHandler.callCount === 1) + + runs(() => { + diffs = repo.getLineDiffDetails('a.txt', 'first line is different', {useIndex: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffDetails('a.txt', 'first line is different', {useIndex: false}) + expect(diffs.length).toBe(3) + }) + }) + }) + }) + + describe('.relativize(path)', () => { + it('relativizes the given path to the working directory of the repository', () => { + repo = git.open(__dirname) + const workingDirectory = repo.getWorkingDirectory() + + expect(repo.relativize(path.join(workingDirectory, 'a.txt'))).toBe('a.txt') + expect(repo.relativize(path.join(workingDirectory, 'a/b/c.txt'))).toBe('a/b/c.txt') + expect(repo.relativize('a.txt')).toBe('a.txt') + expect(repo.relativize('/not/in/working/dir')).toBe('/not/in/working/dir') + expect(repo.relativize(null)).toBe(null) + expect(repo.relativize()).toBeUndefined() + expect(repo.relativize('')).toBe('') + expect(repo.relativize(workingDirectory)).toBe('') + }) + + describe('when the opened path is a symlink', () => { + it('relativizes against both the linked path and the real path', () => { + // Creating symbol link on Windows requires administrator permission so + // we just skip this test. + if (process.platform === 'win32') { return } + + const repoDirectory = fs.realpathSync(temp.mkdirSync('node-git-repo-')) + const linkDirectory = path.join(fs.realpathSync(temp.mkdirSync('node-git-repo-')), 'link') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + fs.symlinkSync(repoDirectory, linkDirectory) + + repo = git.open(linkDirectory) + expect(repo.relativize(path.join(repoDirectory, 'test1'))).toBe('test1') + expect(repo.relativize(path.join(linkDirectory, 'test2'))).toBe('test2') + expect(repo.relativize(path.join(linkDirectory, 'test2/test3'))).toBe('test2/test3') + expect(repo.relativize('test2/test3')).toBe('test2/test3') + }) + }) + + it('handles case insensitive filesystems', () => { + const repoDirectory = temp.mkdirSync('lower-case-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + repo.caseInsensitiveFs = true + const workingDirectory = repo.getWorkingDirectory() + + expect(repo.relativize(path.join(workingDirectory.toUpperCase(), 'a.txt'))).toBe('a.txt') + expect(repo.relativize(path.join(workingDirectory.toUpperCase(), 'a/b/c.txt'))).toBe('a/b/c.txt') + + const linkDirectory = path.join(fs.realpathSync(temp.mkdirSync('lower-case-symlink')), 'link') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + fs.symlinkSync(repoDirectory, linkDirectory) + + repo = git.open(linkDirectory) + repo.caseInsensitiveFs = true + expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2'))).toBe('test2') + expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2/test3'))).toBe('test2/test3') + }) + }) + + describe('.isWorkingDirectory(path)', () => { + it("returns whether the given path is the repository's working directory", () => { + repo = git.open(__dirname) + let workingDirectory = repo.getWorkingDirectory() + + expect(repo.isWorkingDirectory(workingDirectory)).toBe(true) + expect(repo.isWorkingDirectory()).toBe(false) + expect(repo.isWorkingDirectory(null)).toBe(false) + expect(repo.isWorkingDirectory('')).toBe(false) + expect(repo.isWorkingDirectory('test')).toBe(false) + + const repoDirectory = temp.mkdirSync('lower-case-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + repo.caseInsensitiveFs = true + workingDirectory = repo.getWorkingDirectory() + + expect(repo.isWorkingDirectory(workingDirectory.toUpperCase())).toBe(true) + }) + }) + + describe('.submoduleForPath(path)', () => { + beforeEach(() => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + const submoduleDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures', 'master.git'), path.join(repoDirectory, '.git')) + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures', 'master.git'), path.join(submoduleDirectory, '.git')) + + const gitCommandHandler = jasmine.createSpy('gitCommandHandler') + execCommands([`cd ${repoDirectory}`, `git submodule add ${submoduleDirectory} sub`], gitCommandHandler) + + waitsFor(() => gitCommandHandler.callCount === 1) + + runs(() => repo = git.open(repoDirectory)) + }) + + it('returns the repository for the path', () => { + expect(repo.submoduleForPath()).toBe(null) + expect(repo.submoduleForPath(null)).toBe(null) + expect(repo.submoduleForPath('')).toBe(null) + expect(repo.submoduleForPath('sub1')).toBe(null) + + let submoduleRepoPath = path.join(repo.getPath(), 'modules', 'sub/') + if (process.platform === 'win32') { submoduleRepoPath = submoduleRepoPath.replace(/\\/g, '/') } + + expect(repo.submoduleForPath('sub').getPath()).toBe(submoduleRepoPath) + expect(repo.submoduleForPath('sub/').getPath()).toBe(submoduleRepoPath) + expect(repo.submoduleForPath('sub/a').getPath()).toBe(submoduleRepoPath) + expect(repo.submoduleForPath('sub/a/b/c/d').getPath()).toBe(submoduleRepoPath) + }) + }) + + describe('.add(path)', () => { + beforeEach(() => { + const repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) + repo = git.open(repoDirectory) + + const filePath = path.join(repoDirectory, 'toadd.txt') + fs.writeFileSync(filePath, 'changes to stage', 'utf8') + }) + + it('introduces the current state of the file to the index', () => { + expect(repo.getStatus('toadd.txt')).toBe(1 << 7) + repo.add('toadd.txt') + expect(repo.getStatus('toadd.txt')).toBe(1 << 0) + }) + + it("throws an error if the file doesn't exist", () => expect(() => repo.add('missing.txt')).toThrow()) + }) +}) + +function execCommands (commands, callback) { + let command + if (process.platform === 'win32') { + command = commands.join(' & ') + } else { + command = commands.join(' && ') + } + exec(command, callback) +} From d56697596afdb490d006434c4c0bcb2d8704e467 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 25 Sep 2017 17:07:55 -0700 Subject: [PATCH 130/194] Update README - grunt is no more --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d0e4ca1..6e41c1a2 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,7 @@ npm install git-utils * Clone the repository with the `--recurse` option to get the libgit2 submodule * Run `npm install` - * Run `grunt` to compile the native and CoffeeScript code - * Run `grunt test` to run the specs + * Run `npm test` to run the specs ## Docs From 28d7b4d3be2b0ae8eac6f02383352347ee67e658 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 26 Sep 2017 11:45:05 -0700 Subject: [PATCH 131/194] Add async .getStatus API --- .travis.yml | 2 +- spec/git-spec.js | 28 ++++++- src/git.js | 31 ++++++++ src/repository.cc | 195 +++++++++++++++++++++++++++------------------- src/repository.h | 7 +- 5 files changed, 174 insertions(+), 89 deletions(-) diff --git a/.travis.yml b/.travis.yml index a69704d5..b605abba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ notifications: on_success: never on_failure: change -node_js: 6 +node_js: node git: depth: 10 diff --git a/spec/git-spec.js b/spec/git-spec.js index 52b764b8..c5a41bd0 100644 --- a/spec/git-spec.js +++ b/spec/git-spec.js @@ -554,14 +554,25 @@ describe('git', () => { describe('when no path is specified', () => { it('returns the status of all modified paths', () => { const statuses = repo.getStatus() - expect(_.keys(statuses).length).toBe(2) - expect(statuses['a.txt']).toBe(1 << 9) - expect(statuses['b.txt']).toBe(1 << 7) + expect(statuses).toEqual({ + 'a.txt': 1 << 9, + 'b.txt': 1 << 7 + }) + }) + + it('resolves with the status of all modified paths', async () => { + const statuses = await repo.getStatusAsync() + expect(statuses).toEqual({ + 'a.txt': 1 << 9, + 'b.txt': 1 << 7 + }) }) }) describe('when a path is specified', () => { - it('returns the status of the given path', () => expect(repo.getStatus('a.txt')).toBe(1 << 9)) + it('returns the status of the given path', () => { + expect(repo.getStatus('a.txt')).toBe(1 << 9) + }) }) }) @@ -588,6 +599,15 @@ describe('git', () => { expect(repo.isStatusNew(status)).toBe(false) }) + it('returns the status of only that path', async () => { + const statuses = await repo.getStatusForPathsAsync(['dir/**']) + expect(_.keys(statuses).length).toBe(1) + + const status = statuses['dir/a.txt'] + expect(repo.isStatusModified(status)).toBe(true) + expect(repo.isStatusNew(status)).toBe(false) + }) + it('returns the status of only that path2', () => { fs.writeFileSync(filePath, '', 'utf8') diff --git a/src/git.js b/src/git.js index 980ad41a..3a366ec4 100644 --- a/src/git.js +++ b/src/git.js @@ -227,6 +227,37 @@ Repository.prototype.isWorkingDirectory = function (path) { return false } +const {getStatus, getStatusAsync, getStatusForPath} = Repository.prototype +delete Repository.prototype.getStatusForPath + +Repository.prototype.getStatusForPaths = function (paths) { + if (paths && paths.length > 0) { + return getStatus.call(this, paths) + } else { + return {} + } +} + +Repository.prototype.getStatus = function (path) { + if (typeof path === 'string') { + return getStatusForPath.call(this, path) + } else { + return getStatus.call(this) + } +} + +Repository.prototype.getStatusAsync = function () { + return new Promise((resolve, reject) => + getStatusAsync.call(this, (error, result) => error ? reject(error) : resolve(result)) + ) +} + +Repository.prototype.getStatusForPathsAsync = function (paths) { + return new Promise((resolve, reject) => + getStatusAsync.call(this, (error, result) => error ? reject(error) : resolve(result), paths) + ) +} + function realpath (unrealPath) { try { return fs.realpathSync(unrealPath) diff --git a/src/repository.cc b/src/repository.cc index 64e5e0c5..77117a28 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -20,9 +20,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "repository.h" - #include - #include #include @@ -48,8 +46,8 @@ void Repository::Init(Local target) { Nan::SetMethod(proto, "getConfigValue", Repository::GetConfigValue); Nan::SetMethod(proto, "setConfigValue", Repository::SetConfigValue); Nan::SetMethod(proto, "getStatus", Repository::GetStatus); - Nan::SetMethod(proto, "getStatusForPaths", - Repository::GetStatusForPaths); + Nan::SetMethod(proto, "getStatusForPath", Repository::GetStatusForPath); + Nan::SetMethod(proto, "getStatusAsync", Repository::GetStatusAsync); Nan::SetMethod(proto, "checkoutHead", Repository::CheckoutHead); Nan::SetMethod(proto, "getReferenceTarget", Repository::GetReferenceTarget); Nan::SetMethod(proto, "getDiffStats", Repository::GetDiffStats); @@ -82,6 +80,10 @@ git_repository* Repository::GetRepository(Nan::NAN_METHOD_ARGS_TYPE args) { return Nan::ObjectWrap::Unwrap(args.This())->repository; } +git_repository* Repository::GetAsyncRepository(Nan::NAN_METHOD_ARGS_TYPE args) { + return Nan::ObjectWrap::Unwrap(args.This())->async_repository; +} + int Repository::GetBlob(Nan::NAN_METHOD_ARGS_TYPE args, git_repository* repo, git_blob*& blob) { std::string path(*String::Utf8Value(args[0])); @@ -299,84 +301,103 @@ NAN_METHOD(Repository::SetConfigValue) { return info.GetReturnValue().Set(Nan::New(errorCode == GIT_OK)); } +static int StatusCallback(const char* path, unsigned int status, void* payload) { + auto statuses = static_cast *>(payload); + statuses->insert(std::make_pair(std::string(path), status)); + return GIT_OK; +} -NAN_METHOD(Repository::GetStatus) { - Nan::HandleScope scope; - if (info.Length() < 1) { - Local result = Nan::New(); - std::map statuses; +class StatusWorker : public Nan::AsyncWorker { + git_repository *repository; + std::map statuses; + char **paths; + unsigned path_count; + int code; + + public: + void Execute() { git_status_options options = GIT_STATUS_OPTIONS_INIT; - options.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | - GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS; - if (git_status_foreach_ext(GetRepository(info), - &options, - StatusCallback, - &statuses) == GIT_OK) { - std::map::iterator iter = statuses.begin(); - for (; iter != statuses.end(); ++iter) - result->Set(Nan::New(iter->first.c_str()).ToLocalChecked(), - Nan::New(iter->second)); + options.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS; + + if (paths) { + options.pathspec.count = path_count; + options.pathspec.strings = paths; } - return info.GetReturnValue().Set(result); - } else { - git_repository* repository = GetRepository(info); - std::string path(*String::Utf8Value(info[0])); - unsigned int status = 0; - if (git_status_file(&status, repository, path.c_str()) == GIT_OK) - return info.GetReturnValue().Set(Nan::New(status)); - else - return info.GetReturnValue().Set(Nan::New(0)); - } -} -NAN_METHOD(Repository::GetStatusForPaths) { - Nan::HandleScope scope; + code = git_status_foreach_ext(repository, &options, StatusCallback, &statuses); - Local result = Nan::New(); - if (info.Length() < 1) - return info.GetReturnValue().Set(result); + if (paths) { + git_strarray_free(&options.pathspec); + } + } - std::map statuses; - git_status_options options = GIT_STATUS_OPTIONS_INIT; - // Ideally we'd use GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH here since we want - // to limit to a path, not a pathspec, but libgit2 seems to have a bug here: - // https://github.com/libgit2/libgit2/pull/3609 - options.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | - GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS; - - Array *pathsArg = Array::Cast(*info[0]); - unsigned int pathsLength = pathsArg->Length(); - if (pathsLength < 1) - return info.GetReturnValue().Set(result); + std::pair, Local> Finish() { + if (code == GIT_OK) { + Local result = Nan::New(); + for (auto iter = statuses.begin(), end = statuses.end(); iter != end; ++iter) { + result->Set( + Nan::New(iter->first.c_str()).ToLocalChecked(), + Nan::New(iter->second) + ); + } + return {Nan::Null(), result}; + } else { + return {Nan::Error("Git status failed"), Nan::Null()}; + } + } - char *path = NULL; - char **paths = reinterpret_cast(malloc(pathsLength * sizeof(path))); - for (unsigned int i = 0; i < pathsLength; i++) { - String::Utf8Value utf8Path(pathsArg->Get(i)); - path = strdup(*utf8Path); - paths[i] = path; + void HandleOKCallback() { + auto result = Finish(); + Local argv[] = {result.first, result.second}; + callback->Call(2, argv); } - git_strarray pathsArray; - pathsArray.count = pathsLength; - pathsArray.strings = paths; - options.pathspec = pathsArray; - - if (git_status_foreach_ext(GetRepository(info), - &options, - StatusCallback, - &statuses) == GIT_OK) { - std::map::iterator iter = statuses.begin(); - for (; iter != statuses.end(); ++iter) - result->Set(Nan::New(iter->first.c_str()).ToLocalChecked(), - Nan::New(iter->second)); + StatusWorker(Nan::Callback *callback, git_repository *repository, Local path_filter) + : Nan::AsyncWorker(callback), + repository(repository) { + + if (path_filter->IsArray()) { + Local js_paths = Local::Cast(path_filter); + path_count = js_paths->Length(); + paths = reinterpret_cast(malloc(path_count * sizeof(char *))); + for (unsigned i = 0; i < path_count; i++) { + auto js_path = Local::Cast(js_paths->Get(i)); + paths[i] = reinterpret_cast(malloc(js_path->Utf8Length() + 1)); + js_path->WriteUtf8(paths[i]); + } + } else { + paths = NULL; + path_count = 0; + } } +}; - if (paths != NULL) { - git_strarray_free(&pathsArray); +NAN_METHOD(Repository::GetStatusAsync) { + auto callback = new Nan::Callback(Local::Cast(info[0])); + Local path_filter = info.Length() > 1 ? info[1] : Local::Cast(Nan::Null()); + Nan::AsyncQueueWorker(new StatusWorker(callback, GetAsyncRepository(info), path_filter)); +} + +NAN_METHOD(Repository::GetStatus) { + Local path_filter = info.Length() > 0 ? info[0] : Local::Cast(Nan::Null()); + StatusWorker worker(NULL, GetRepository(info), path_filter); + worker.Execute(); + auto result = worker.Finish(); + if (result.first->IsNull()) { + info.GetReturnValue().Set(worker.Finish().second); + } else { + info.GetReturnValue().Set(Nan::New()); } +} - return info.GetReturnValue().Set(result); +NAN_METHOD(Repository::GetStatusForPath) { + git_repository* repository = GetRepository(info); + String::Utf8Value path(info[0]); + unsigned int status = 0; + if (git_status_file(&status, repository, *path) == GIT_OK) + return info.GetReturnValue().Set(Nan::New(status)); + else + return info.GetReturnValue().Set(Nan::New(0)); } NAN_METHOD(Repository::CheckoutHead) { @@ -584,14 +605,6 @@ NAN_METHOD(Repository::GetIndexBlob) { return info.GetReturnValue().Set(value); } -int Repository::StatusCallback( - const char* path, unsigned int status, void* payload) { - std::map* statuses = - static_cast*>(payload); - statuses->insert(std::make_pair(std::string(path), status)); - return GIT_OK; -} - int Repository::SubmoduleCallback( git_submodule* submodule, const char* name, void* payload) { std::vector* submodules = @@ -967,13 +980,29 @@ Repository::Repository(Local path, Local search) { Nan::HandleScope scope; int flags = 0; - if (!search->BooleanValue()) + if (!search->BooleanValue()) { flags |= GIT_REPOSITORY_OPEN_NO_SEARCH; + } + + String::Utf8Value repository_path(path); + int result = git_repository_open_ext(&repository, *repository_path, flags, NULL); + if (result != GIT_OK) { + repository = NULL; + async_repository = NULL; + return; + } - std::string repositoryPath(*String::Utf8Value(path)); - if (git_repository_open_ext( - &repository, repositoryPath.c_str(), flags, NULL) != GIT_OK) + result = git_repository_open_ext( + &async_repository, + git_repository_path(repository), + GIT_REPOSITORY_OPEN_NO_SEARCH, + NULL + ); + if (result != GIT_OK) { repository = NULL; + async_repository = NULL; + return; + } } Repository::~Repository() { @@ -981,4 +1010,8 @@ Repository::~Repository() { git_repository_free(repository); repository = NULL; } + if (async_repository != NULL) { + git_repository_free(async_repository); + async_repository = NULL; + } } diff --git a/src/repository.h b/src/repository.h index 069a97c9..49c466cc 100644 --- a/src/repository.h +++ b/src/repository.h @@ -46,7 +46,8 @@ class Repository : public Nan::ObjectWrap { static NAN_METHOD(GetConfigValue); static NAN_METHOD(SetConfigValue); static NAN_METHOD(GetStatus); - static NAN_METHOD(GetStatusForPaths); + static NAN_METHOD(GetStatusAsync); + static NAN_METHOD(GetStatusForPath); static NAN_METHOD(CheckoutHead); static NAN_METHOD(GetReferenceTarget); static NAN_METHOD(GetDiffStats); @@ -61,8 +62,6 @@ class Repository : public Nan::ObjectWrap { static NAN_METHOD(CheckoutReference); static NAN_METHOD(Add); - static int StatusCallback(const char *path, unsigned int status, - void *payload); static int DiffHunkCallback(const git_diff_delta *delta, const git_diff_hunk *hunk, void *payload); @@ -77,6 +76,7 @@ class Repository : public Nan::ObjectWrap { const std::vector& vector); static git_repository* GetRepository(Nan::NAN_METHOD_ARGS_TYPE args); + static git_repository* GetAsyncRepository(Nan::NAN_METHOD_ARGS_TYPE args); static int GetBlob(Nan::NAN_METHOD_ARGS_TYPE args, git_repository* repo, git_blob*& blob); @@ -87,6 +87,7 @@ class Repository : public Nan::ObjectWrap { ~Repository(); git_repository* repository; + git_repository* async_repository; }; #endif // SRC_REPOSITORY_H_ From 9b21b006f91832b51006d90c83d8f0150ba1f697 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 26 Sep 2017 12:26:17 -0700 Subject: [PATCH 132/194] Make async tests work properly --- spec/async-spec-helper-functions.js | 53 +++++++++++++++++++++++++++++ spec/git-spec.js | 1 + 2 files changed, 54 insertions(+) create mode 100644 spec/async-spec-helper-functions.js diff --git a/spec/async-spec-helper-functions.js b/spec/async-spec-helper-functions.js new file mode 100644 index 00000000..497063f5 --- /dev/null +++ b/spec/async-spec-helper-functions.js @@ -0,0 +1,53 @@ +exports.beforeEach = function beforeEach (fn) { + global.beforeEach(function () { + const result = fn() + if (result instanceof Promise) { + waitsForPromise(result) + } + }) +} + +exports.afterEach = function afterEach (fn) { + global.afterEach(function () { + const result = fn() + if (result instanceof Promise) { + waitsForPromise(result) + } + }) +} + +;['it', 'fit', 'ffit', 'fffit'].forEach((name) => { + exports[name] = function (description, fn) { + if (fn === undefined) { + global[name](description) + return + } + + global[name](description, () => { + const result = fn() + if (result instanceof Promise) { + waitsForPromise(result) + } + }) + } +}) + +function waitsForPromise (promise) { + let done = false + let error = null + + global.waitsFor('test promise to resolve', () => { + expect(error).toBeNull() + return done + }) + + promise.then( + () => { + done = true + }, + (e) => { + error = e + done = true + }, + ) +} diff --git a/spec/git-spec.js b/spec/git-spec.js index c5a41bd0..80ed6a99 100644 --- a/spec/git-spec.js +++ b/spec/git-spec.js @@ -5,6 +5,7 @@ const {exec} = require('child_process') const wrench = require('wrench') const temp = require('temp') const _ = require('underscore') +const {it, fit, beforeEach} = require('./async-spec-helper-functions') describe('git', () => { let repo From 6b61bd23a699fbfc0f3b0aaaf6837c9f2bb675f1 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 26 Sep 2017 12:57:50 -0700 Subject: [PATCH 133/194] Add async version of .getHead --- spec/async-spec-helper-functions.js | 13 +++--- spec/git-spec.js | 10 +++++ src/git.js | 8 +++- src/repository.cc | 64 +++++++++++++++++++++-------- src/repository.h | 1 + 5 files changed, 70 insertions(+), 26 deletions(-) diff --git a/spec/async-spec-helper-functions.js b/spec/async-spec-helper-functions.js index 497063f5..bc969536 100644 --- a/spec/async-spec-helper-functions.js +++ b/spec/async-spec-helper-functions.js @@ -2,7 +2,7 @@ exports.beforeEach = function beforeEach (fn) { global.beforeEach(function () { const result = fn() if (result instanceof Promise) { - waitsForPromise(result) + waitsForPromise(result, this) } }) } @@ -11,7 +11,7 @@ exports.afterEach = function afterEach (fn) { global.afterEach(function () { const result = fn() if (result instanceof Promise) { - waitsForPromise(result) + waitsForPromise(result, this) } }) } @@ -23,21 +23,20 @@ exports.afterEach = function afterEach (fn) { return } - global[name](description, () => { + global[name](description, function () { const result = fn() if (result instanceof Promise) { - waitsForPromise(result) + waitsForPromise(result, this) } }) } }) -function waitsForPromise (promise) { +function waitsForPromise (promise, spec) { let done = false let error = null global.waitsFor('test promise to resolve', () => { - expect(error).toBeNull() return done }) @@ -46,7 +45,7 @@ function waitsForPromise (promise) { done = true }, (e) => { - error = e + spec.fail(e) done = true }, ) diff --git a/spec/git-spec.js b/spec/git-spec.js index 80ed6a99..3379353f 100644 --- a/spec/git-spec.js +++ b/spec/git-spec.js @@ -59,6 +59,11 @@ describe('git', () => { repo = git.open(path.join(__dirname, 'fixtures/master.git')) expect(repo.getHead()).toBe('refs/heads/master') }) + + it("resolves with the branch's full path", async () => { + repo = git.open(path.join(__dirname, 'fixtures/master.git')) + expect(await repo.getHeadAsync()).toBe('refs/heads/master') + }) }) describe('when the HEAD is detached', () => { @@ -66,6 +71,11 @@ describe('git', () => { repo = git.open(path.join(__dirname, 'fixtures/detached.git')) expect(repo.getHead()).toBe('50719ab369dcbbc2fb3b7a0167c52accbd0eb40e') }) + + it('return the SHA-1 that is checked out', async () => { + repo = git.open(path.join(__dirname, 'fixtures/detached.git')) + expect(await repo.getHead()).toBe('50719ab369dcbbc2fb3b7a0167c52accbd0eb40e') + }) }) }) diff --git a/src/git.js b/src/git.js index 3a366ec4..0ffd84ad 100644 --- a/src/git.js +++ b/src/git.js @@ -227,7 +227,7 @@ Repository.prototype.isWorkingDirectory = function (path) { return false } -const {getStatus, getStatusAsync, getStatusForPath} = Repository.prototype +const {getHeadAsync, getStatus, getStatusAsync, getStatusForPath} = Repository.prototype delete Repository.prototype.getStatusForPath Repository.prototype.getStatusForPaths = function (paths) { @@ -246,6 +246,12 @@ Repository.prototype.getStatus = function (path) { } } +Repository.prototype.getHeadAsync = function () { + return new Promise((resolve, reject) => + getHeadAsync.call(this, (error, result) => error ? reject(error) : resolve(result)) + ) +} + Repository.prototype.getStatusAsync = function () { return new Promise((resolve, reject) => getStatusAsync.call(this, (error, result) => error ? reject(error) : resolve(result)) diff --git a/src/repository.cc b/src/repository.cc index 77117a28..8852935f 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -40,6 +40,7 @@ void Repository::Init(Local target) { Nan::SetMethod(proto, "exists", Repository::Exists); Nan::SetMethod(proto, "getSubmodulePaths", Repository::GetSubmodulePaths); Nan::SetMethod(proto, "getHead", Repository::GetHead); + Nan::SetMethod(proto, "getHeadAsync", Repository::GetHeadAsync); Nan::SetMethod(proto, "refreshIndex", Repository::RefreshIndex); Nan::SetMethod(proto, "isIgnored", Repository::IsIgnored); Nan::SetMethod(proto, "isSubmodule", Repository::IsSubmodule); @@ -189,28 +190,55 @@ NAN_METHOD(Repository::GetSubmodulePaths) { info.GetReturnValue().Set(v8Paths); } -NAN_METHOD(Repository::GetHead) { - Nan::HandleScope scope; - git_repository* repository = GetRepository(info); - git_reference* head; - if (git_repository_head(&head, repository) != GIT_OK) - return info.GetReturnValue().Set(Nan::Null()); +class HeadWorker : public Nan::AsyncWorker { + git_repository *repository; + std::string result; - if (git_repository_head_detached(repository) == 1) { - const git_oid* sha = git_reference_target(head); - if (sha != NULL) { - char oid[GIT_OID_HEXSZ + 1]; - git_oid_tostr(oid, GIT_OID_HEXSZ + 1, sha); - git_reference_free(head); - return info.GetReturnValue().Set(Nan::New(oid, -1) - .ToLocalChecked()); + public: + void Execute() { + git_reference *head; + if (git_repository_head(&head, repository) != GIT_OK) return; + + if (git_repository_head_detached(repository) == 1) { + const git_oid *oid = git_reference_target(head); + if (oid) { + result.resize(GIT_OID_HEXSZ); + git_oid_tostr(&result[0], GIT_OID_HEXSZ + 1, oid); + } + } else { + result = git_reference_name(head); } + + git_reference_free(head); } - Local referenceName = Nan::New(git_reference_name(head)) - .ToLocalChecked(); - git_reference_free(head); - return info.GetReturnValue().Set(referenceName); + std::pair, Local> Finish() { + if (result.empty()) { + return {Nan::Error("Git head failed"), Nan::Null()}; + } else { + return {Nan::Null(), Nan::New(result).ToLocalChecked()}; + } + } + + void HandleOKCallback() { + auto result = Finish(); + Local argv[] = {result.first, result.second}; + callback->Call(2, argv); + } + + HeadWorker(Nan::Callback *callback, git_repository *repository) + : Nan::AsyncWorker(callback), repository(repository) {} +}; + +NAN_METHOD(Repository::GetHead) { + HeadWorker worker(NULL, GetRepository(info)); + worker.Execute(); + info.GetReturnValue().Set(worker.Finish().second); +} + +NAN_METHOD(Repository::GetHeadAsync) { + auto callback = new Nan::Callback(Local::Cast(info[0])); + Nan::AsyncQueueWorker(new HeadWorker(callback, GetAsyncRepository(info))); } NAN_METHOD(Repository::RefreshIndex) { diff --git a/src/repository.h b/src/repository.h index 49c466cc..e2ac4428 100644 --- a/src/repository.h +++ b/src/repository.h @@ -40,6 +40,7 @@ class Repository : public Nan::ObjectWrap { static NAN_METHOD(GetSubmodulePaths); static NAN_METHOD(Exists); static NAN_METHOD(GetHead); + static NAN_METHOD(GetHeadAsync); static NAN_METHOD(RefreshIndex); static NAN_METHOD(IsIgnored); static NAN_METHOD(IsSubmodule); From 00edeaa2e891dab9b5a910c22c9b7259cac6249c Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 26 Sep 2017 15:51:11 -0700 Subject: [PATCH 134/194] Add async version of getAheadBehindCount --- spec/git-spec.js | 17 +++++++ src/git.js | 36 +++++++++++---- src/repository.cc | 115 +++++++++++++++++++++++++++------------------- src/repository.h | 4 +- 4 files changed, 115 insertions(+), 57 deletions(-) diff --git a/spec/git-spec.js b/spec/git-spec.js index 3379353f..a7d2b81a 100644 --- a/spec/git-spec.js +++ b/spec/git-spec.js @@ -672,6 +672,23 @@ describe('git', () => { counts = repo.getAheadBehindCount('') expect(counts).toEqual({ahead: 0, behind: 0}) }) + + it('returns the number of commits ahead of and behind the upstream branch', async () => { + let counts = await repo.getAheadBehindCountAsync() + expect(counts).toEqual({ahead: 3, behind: 2}) + + counts = await repo.getAheadBehindCountAsync('refs/heads/master') + expect(counts).toEqual({ahead: 3, behind: 2}) + + counts = await repo.getAheadBehindCountAsync('master') + expect(counts).toEqual({ahead: 3, behind: 2}) + + counts = await repo.getAheadBehindCountAsync('refs/heads/masterblaster') + expect(counts).toEqual({ahead: 0, behind: 0}) + + counts = await repo.getAheadBehindCountAsync('') + expect(counts).toEqual({ahead: 0, behind: 0}) + }) }) describe('.getLineDiffs(path, text, options)', () => { diff --git a/src/git.js b/src/git.js index 0ffd84ad..90e163bd 100644 --- a/src/git.js +++ b/src/git.js @@ -114,21 +114,39 @@ Repository.prototype.getAheadBehindCount = function (branch = 'HEAD') { branch = `refs/heads/${branch}` } - const counts = {ahead: 0, behind: 0} const headCommit = this.getReferenceTarget(branch) - if (!headCommit || headCommit.length === 0) return counts + if (!headCommit || headCommit.length === 0) return {ahead: 0, behind: 0} const upstream = this.getUpstreamBranch() - if (!upstream || upstream.length === 0) return counts + if (!upstream || upstream.length === 0) return {ahead: 0, behind: 0} + const upstreamCommit = this.getReferenceTarget(upstream) - if (!upstreamCommit || upstreamCommit.length === 0) return counts + if (!upstreamCommit || upstreamCommit.length === 0) return {ahead: 0, behind: 0} + + return this.compareCommits(headCommit, upstreamCommit) +} - const mergeBase = this.getMergeBase(headCommit, upstreamCommit) - if (!mergeBase || mergeBase.length === 0) return counts +Repository.prototype.getAheadBehindCountAsync = function (branch = 'HEAD') { + if (branch !== 'HEAD' && !branch.startsWith('refs/heads/')) { + branch = `refs/heads/${branch}` + } - counts.ahead = this.getCommitCount(headCommit, mergeBase) - counts.behind = this.getCommitCount(upstreamCommit, mergeBase) - return counts + const headCommit = this.getReferenceTarget(branch) + if (!headCommit || headCommit.length === 0) return {ahead: 0, behind: 0} + + const upstream = this.getUpstreamBranch() + if (!upstream || upstream.length === 0) return {ahead: 0, behind: 0} + + const upstreamCommit = this.getReferenceTarget(upstream) + if (!upstreamCommit || upstreamCommit.length === 0) return {ahead: 0, behind: 0} + + return new Promise((resolve, reject) => { + this.compareCommitsAsync( + (error, result) => error ? reject(error) : resolve(result), + headCommit, + upstreamCommit + ) + }) } Repository.prototype.checkoutReference = function (branch, create) { diff --git a/src/repository.cc b/src/repository.cc index 8852935f..a570bbc7 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -54,8 +54,8 @@ void Repository::Init(Local target) { Nan::SetMethod(proto, "getDiffStats", Repository::GetDiffStats); Nan::SetMethod(proto, "getIndexBlob", Repository::GetIndexBlob); Nan::SetMethod(proto, "getHeadBlob", Repository::GetHeadBlob); - Nan::SetMethod(proto, "getCommitCount", Repository::GetCommitCount); - Nan::SetMethod(proto, "getMergeBase", Repository::GetMergeBase); + Nan::SetMethod(proto, "compareCommits", Repository::CompareCommits); + Nan::SetMethod(proto, "compareCommitsAsync", Repository::CompareCommitsAsync); Nan::SetMethod(proto, "_release", Repository::Release); Nan::SetMethod(proto, "getLineDiffs", Repository::GetLineDiffs); Nan::SetMethod(proto, "getLineDiffDetails", Repository::GetLineDiffDetails); @@ -653,60 +653,83 @@ NAN_METHOD(Repository::Release) { info.GetReturnValue().SetUndefined(); } -NAN_METHOD(Repository::GetCommitCount) { - Nan::HandleScope scope; - if (info.Length() < 2) - return info.GetReturnValue().Set(Nan::New(0)); - - std::string fromCommitId(*String::Utf8Value(info[0])); - git_oid fromCommit; - if (git_oid_fromstr(&fromCommit, fromCommitId.c_str()) != GIT_OK) - return info.GetReturnValue().Set(Nan::New(0)); +unsigned GetCommitCount(git_repository *repository, git_oid *left_oid, git_oid *right_oid) { + git_revwalk *revwalk; + if (git_revwalk_new(&revwalk, repository) != GIT_OK) return 0; - std::string toCommitId(*String::Utf8Value(info[1])); - git_oid toCommit; - if (git_oid_fromstr(&toCommit, toCommitId.c_str()) != GIT_OK) - return info.GetReturnValue().Set(Nan::New(0)); + git_revwalk_push(revwalk, left_oid); + git_revwalk_hide(revwalk, right_oid); - git_revwalk* revWalk; - if (git_revwalk_new(&revWalk, GetRepository(info)) != GIT_OK) - return info.GetReturnValue().Set(Nan::New(0)); + unsigned result = 0; + git_oid current_commit; + while (git_revwalk_next(¤t_commit, revwalk) == GIT_OK) result++; + git_revwalk_free(revwalk); - git_revwalk_push(revWalk, &fromCommit); - git_revwalk_hide(revWalk, &toCommit); - git_oid currentCommit; - int count = 0; - while (git_revwalk_next(¤tCommit, revWalk) == GIT_OK) - count++; - git_revwalk_free(revWalk); - return info.GetReturnValue().Set(Nan::New(count)); + return result; } -NAN_METHOD(Repository::GetMergeBase) { - Nan::HandleScope scope; - if (info.Length() < 2) - return info.GetReturnValue().Set(Nan::Null()); +class CompareCommitsWorker : public Nan::AsyncWorker { + git_repository *repository; + std::string left_id; + std::string right_id; + unsigned ahead_count; + unsigned behind_count; - std::string commitOneId(*String::Utf8Value(info[0])); - git_oid commitOne; - if (git_oid_fromstr(&commitOne, commitOneId.c_str()) != GIT_OK) - return info.GetReturnValue().Set(Nan::Null()); + public: + void Execute() { + git_oid left_oid; + if (git_oid_fromstr(&left_oid, left_id.c_str()) != GIT_OK) return; - std::string commitTwoId(*String::Utf8Value(info[1])); - git_oid commitTwo; - if (git_oid_fromstr(&commitTwo, commitTwoId.c_str()) != GIT_OK) - return info.GetReturnValue().Set(Nan::Null()); + git_oid right_oid; + if (git_oid_fromstr(&right_oid, right_id.c_str()) != GIT_OK) return; - git_oid mergeBase; - if (git_merge_base( - &mergeBase, GetRepository(info), &commitOne, &commitTwo) == GIT_OK) { - char mergeBaseId[GIT_OID_HEXSZ + 1]; - git_oid_tostr(mergeBaseId, GIT_OID_HEXSZ + 1, &mergeBase); - return info.GetReturnValue().Set(Nan::New(mergeBaseId, -1) - .ToLocalChecked()); + git_oid merge_base; + if (git_merge_base(&merge_base, repository, &left_oid, &right_oid) != GIT_OK) return; + + ahead_count = GetCommitCount(repository, &left_oid, &merge_base); + behind_count = GetCommitCount(repository, &right_oid, &merge_base); } - return info.GetReturnValue().Set(Nan::Null()); + std::pair, Local> Finish() { + Local result = Nan::New(); + result->Set(Nan::New("ahead").ToLocalChecked(), Nan::New(ahead_count)); + result->Set(Nan::New("behind").ToLocalChecked(), Nan::New(behind_count)); + return {Nan::Null(), result}; + } + + void HandleOKCallback() { + auto result = Finish(); + Local argv[] = {result.first, result.second}; + callback->Call(2, argv); + } + + CompareCommitsWorker(Nan::Callback *callback, git_repository *repository, + Local js_left_id, Local js_right_id) + : Nan::AsyncWorker(callback), repository(repository) { + left_id = *String::Utf8Value(js_left_id); + right_id = *String::Utf8Value(js_right_id); + } +}; + +NAN_METHOD(Repository::CompareCommits) { + if (info.Length() < 2) { + info.GetReturnValue().Set(Nan::Null()); + return; + } + + CompareCommitsWorker worker(NULL, GetRepository(info), info[0], info[1]); + worker.Execute(); + info.GetReturnValue().Set(worker.Finish().second); +} + +NAN_METHOD(Repository::CompareCommitsAsync) { + if (info.Length() < 2) { + info.GetReturnValue().Set(Nan::Null()); + return; + } + + auto callback = new Nan::Callback(Local::Cast(info[0])); + Nan::AsyncQueueWorker(new CompareCommitsWorker(callback, GetAsyncRepository(info), info[1], info[2])); } int Repository::DiffHunkCallback(const git_diff_delta* delta, diff --git a/src/repository.h b/src/repository.h index e2ac4428..cddc4465 100644 --- a/src/repository.h +++ b/src/repository.h @@ -54,8 +54,8 @@ class Repository : public Nan::ObjectWrap { static NAN_METHOD(GetDiffStats); static NAN_METHOD(GetIndexBlob); static NAN_METHOD(GetHeadBlob); - static NAN_METHOD(GetCommitCount); - static NAN_METHOD(GetMergeBase); + static NAN_METHOD(CompareCommits); + static NAN_METHOD(CompareCommitsAsync); static NAN_METHOD(Release); static NAN_METHOD(GetLineDiffs); static NAN_METHOD(GetLineDiffDetails); From c15904da1de721c296187f299647d05335da5ed0 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 26 Sep 2017 15:54:16 -0700 Subject: [PATCH 135/194] Fix test descriptions --- spec/git-spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/git-spec.js b/spec/git-spec.js index a7d2b81a..27a931dc 100644 --- a/spec/git-spec.js +++ b/spec/git-spec.js @@ -72,9 +72,9 @@ describe('git', () => { expect(repo.getHead()).toBe('50719ab369dcbbc2fb3b7a0167c52accbd0eb40e') }) - it('return the SHA-1 that is checked out', async () => { + it('resolves with the SHA-1 that is checked out', async () => { repo = git.open(path.join(__dirname, 'fixtures/detached.git')) - expect(await repo.getHead()).toBe('50719ab369dcbbc2fb3b7a0167c52accbd0eb40e') + expect(await repo.getHeadAsync()).toBe('50719ab369dcbbc2fb3b7a0167c52accbd0eb40e') }) }) }) @@ -610,7 +610,7 @@ describe('git', () => { expect(repo.isStatusNew(status)).toBe(false) }) - it('returns the status of only that path', async () => { + it('resolves with the status of only that path', async () => { const statuses = await repo.getStatusForPathsAsync(['dir/**']) expect(_.keys(statuses).length).toBe(1) @@ -673,7 +673,7 @@ describe('git', () => { expect(counts).toEqual({ahead: 0, behind: 0}) }) - it('returns the number of commits ahead of and behind the upstream branch', async () => { + it('resolves with the number of commits ahead of and behind the upstream branch', async () => { let counts = await repo.getAheadBehindCountAsync() expect(counts).toEqual({ahead: 3, behind: 2}) From ad8c620d9e899136a85a2eadcde5bdad3cd9c67b Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 26 Sep 2017 17:04:30 -0700 Subject: [PATCH 136/194] Serialize async calls --- spec/git-spec.js | 28 ++++++++++++++++++++++++++++ src/git.js | 41 +++++++++++++++++++++++++---------------- 2 files changed, 53 insertions(+), 16 deletions(-) diff --git a/spec/git-spec.js b/spec/git-spec.js index 27a931dc..bbd6ee94 100644 --- a/spec/git-spec.js +++ b/spec/git-spec.js @@ -962,6 +962,34 @@ describe('git', () => { it("throws an error if the file doesn't exist", () => expect(() => repo.add('missing.txt')).toThrow()) }) + + it('can handle multiple simultaneous async calls', async () => { + repoDirectory = temp.mkdirSync('node-git-repo-') + wrench.copyDirSyncRecursive( + path.join(__dirname, 'fixtures/subdir.git'), + path.join(repoDirectory, '.git') + ) + repo = git.open(repoDirectory) + + const operations = [ + () => repo.getAheadBehindCountAsync(), + () => repo.getHeadAsync(), + () => repo.getStatusAsync(), + () => repo.getStatusAsync(['*']), + ] + + for (let i = 0; i < 20; i++) { + const promises = [] + for (let j = 0, count = random(100); j < count; j++) { + promises.push(operations[random(operations.length)]()) + } + await Promise.all(promises) + } + + function random (max) { + return Math.floor(Math.random() * max) + } + }) }) function execCommands (commands, callback) { diff --git a/src/git.js b/src/git.js index 90e163bd..217e6038 100644 --- a/src/git.js +++ b/src/git.js @@ -140,13 +140,11 @@ Repository.prototype.getAheadBehindCountAsync = function (branch = 'HEAD') { const upstreamCommit = this.getReferenceTarget(upstream) if (!upstreamCommit || upstreamCommit.length === 0) return {ahead: 0, behind: 0} - return new Promise((resolve, reject) => { - this.compareCommitsAsync( - (error, result) => error ? reject(error) : resolve(result), - headCommit, - upstreamCommit - ) - }) + return performAsyncWork(this, done => this.compareCommitsAsync( + done, + headCommit, + upstreamCommit + )) } Repository.prototype.checkoutReference = function (branch, create) { @@ -265,20 +263,31 @@ Repository.prototype.getStatus = function (path) { } Repository.prototype.getHeadAsync = function () { - return new Promise((resolve, reject) => - getHeadAsync.call(this, (error, result) => error ? reject(error) : resolve(result)) - ) + return performAsyncWork(this, done => getHeadAsync.call(this, done)) } Repository.prototype.getStatusAsync = function () { - return new Promise((resolve, reject) => - getStatusAsync.call(this, (error, result) => error ? reject(error) : resolve(result)) - ) + return performAsyncWork(this, done => getStatusAsync.call(this, done)) } Repository.prototype.getStatusForPathsAsync = function (paths) { - return new Promise((resolve, reject) => - getStatusAsync.call(this, (error, result) => error ? reject(error) : resolve(result), paths) + return performAsyncWork(this, done => getStatusAsync.call(this, done, paths)) +} + +function performAsyncWork (repo, fn) { + fn = promisify(fn) + + if (repo._lastAsyncPromise) { + repo._lastAsyncPromise = repo._lastAsyncPromise.then(fn, fn) + } else { + repo._lastAsyncPromise = fn() + } + return repo._lastAsyncPromise +} + +function promisify (fn) { + return () => new Promise((resolve, reject) => + fn((error, result) => error ? reject(error) : resolve(result)) ) } @@ -327,7 +336,7 @@ function openSubmodules (repository) { for (let relativePath of repository.getSubmodulePaths()) { if (relativePath) { const submodulePath = path.join(repository.getWorkingDirectory(), relativePath) - const submoduleRepo = openRepository(submodulePath) + const submoduleRepo = openRepository(submodulePath, false) if (submoduleRepo) { if (submoduleRepo.getPath() === repository.getPath()) { submoduleRepo.release() From f8cf5ea5105826e2c9b5e72d2d2f145a4b7c9e78 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 26 Sep 2017 17:05:14 -0700 Subject: [PATCH 137/194] 5.0.1-0 --- package-lock.json | 2257 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 2258 insertions(+), 1 deletion(-) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..feda876b --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2257 @@ +{ + "name": "git-utils", + "version": "5.0.1-0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "acorn": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.2.tgz", + "integrity": "sha512-o96FZLJBPY1lvTuJylGA9Bk3t/GKPPJG8H0ydQQl01crzwJgspa4AEIq/pVTXigmK0PHVQhiAtn8WMBLL9D2WA==", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ajv-keywords": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", + "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", + "dev": true + }, + "amdefine": { + "version": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz", + "integrity": "sha1-/RdHRwDLXMnCtwnwvp0jzjwZjDM=", + "dev": true + }, + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array.prototype.find": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.0.4.tgz", + "integrity": "sha1-VWpcU2LAhkgyPdrrnenRS8GGTJA=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.8.2" + } + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "async": { + "version": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "balanced-match": { + "version": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + }, + "brace-expansion": { + "version": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "integrity": "sha1-cZfX6qm4fmSDkOph/GbIRCdCDfk=", + "dev": true, + "requires": { + "balanced-match": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "1.0.1" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "coffee-script": { + "version": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", + "integrity": "sha1-FQ1rTLUiiUNp7+1qIQHCC8f0pPQ=", + "dev": true + }, + "coffeestack": { + "version": "https://registry.npmjs.org/coffeestack/-/coffeestack-1.1.2.tgz", + "integrity": "sha1-NSePO+uc5vXQraH7bgh4UrZXzpg=", + "dev": true, + "requires": { + "coffee-script": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.8.0.tgz", + "fs-plus": "https://registry.npmjs.org/fs-plus/-/fs-plus-2.9.2.tgz", + "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz" + }, + "dependencies": { + "coffee-script": { + "version": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.8.0.tgz", + "integrity": "sha1-nJ8dK0pSoADe0Vtll5FwNkgmPB0=", + "dev": true, + "requires": { + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz" + } + } + } + }, + "concat-map": { + "version": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "dev": true, + "requires": { + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "readable-stream": "2.3.3", + "typedarray": "0.0.6" + } + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "d": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, + "requires": { + "es5-ext": "0.10.30" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-log": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", + "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.11" + } + }, + "deglob": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.0.tgz", + "integrity": "sha1-TUSr4W7zLHebSXK9FBqAMlApoUo=", + "dev": true, + "requires": { + "find-root": "1.1.0", + "glob": "7.1.2", + "ignore": "3.3.5", + "pkg-config": "1.1.1", + "run-parallel": "1.1.6", + "uniq": "1.0.1" + }, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimatch": "3.0.4", + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + } + } + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz" + } + }, + "doctrine": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", + "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", + "dev": true, + "requires": { + "esutils": "2.0.2", + "isarray": "1.0.0" + } + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es-abstract": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.8.2.tgz", + "integrity": "sha512-dvhwFL3yjQxNNsOWx6exMlaDrRHCRGMQlnx5lsXDCZ/J7G/frgIIl94zhZSp/galVAYp7VzPi1OrAHta89/yGQ==", + "dev": true, + "requires": { + "es-to-primitive": "1.1.1", + "function-bind": "1.1.1", + "has": "1.0.1", + "is-callable": "1.1.3", + "is-regex": "1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "1.1.3", + "is-date-object": "1.0.1", + "is-symbol": "1.0.1" + } + }, + "es5-ext": { + "version": "0.10.30", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.30.tgz", + "integrity": "sha1-cUGhaDZpfbq/qq7uQUlc4p9SyTk=", + "dev": true, + "requires": { + "es6-iterator": "2.0.1", + "es6-symbol": "3.1.1" + } + }, + "es6-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.30", + "es6-symbol": "3.1.1" + } + }, + "es6-map": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.30", + "es6-iterator": "2.0.1", + "es6-set": "0.1.5", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-set": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.30", + "es6-iterator": "2.0.1", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.30" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.30", + "es6-iterator": "2.0.1", + "es6-symbol": "3.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escope": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", + "dev": true, + "requires": { + "es6-map": "0.1.5", + "es6-weak-map": "2.0.2", + "esrecurse": "4.2.0", + "estraverse": "4.2.0" + } + }, + "eslint": { + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", + "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "chalk": "1.1.3", + "concat-stream": "1.6.0", + "debug": "2.6.9", + "doctrine": "2.0.0", + "escope": "3.6.0", + "espree": "3.5.1", + "esquery": "1.0.0", + "estraverse": "4.2.0", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "glob": "7.1.2", + "globals": "9.18.0", + "ignore": "3.3.5", + "imurmurhash": "0.1.4", + "inquirer": "0.12.0", + "is-my-json-valid": "2.16.1", + "is-resolvable": "1.0.0", + "js-yaml": "3.10.0", + "json-stable-stringify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "1.2.1", + "progress": "1.1.8", + "require-uncached": "1.0.3", + "shelljs": "0.7.8", + "strip-bom": "3.0.0", + "strip-json-comments": "2.0.1", + "table": "3.8.3", + "text-table": "0.2.0", + "user-home": "2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimatch": "3.0.4", + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + } + }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "eslint-config-standard": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz", + "integrity": "sha1-wGHk0GbzedwXzVYsZOgZtN1FRZE=", + "dev": true + }, + "eslint-config-standard-jsx": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-4.0.2.tgz", + "integrity": "sha512-F8fRh2WFnTek7dZH9ZaE0PCBwdVGkwVWZmizla/DDNOmg7Tx6B/IlK5+oYpiX29jpu73LszeJj5i1axEZv6VMw==", + "dev": true + }, + "eslint-import-resolver-node": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz", + "integrity": "sha1-Wt2BBujJKNssuiMrzZ76hG49oWw=", + "dev": true, + "requires": { + "debug": "2.6.9", + "object-assign": "4.1.1", + "resolve": "1.4.0" + }, + "dependencies": { + "resolve": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", + "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + } + } + }, + "eslint-module-utils": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz", + "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", + "dev": true, + "requires": { + "debug": "2.6.9", + "pkg-dir": "1.0.0" + } + }, + "eslint-plugin-import": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.2.0.tgz", + "integrity": "sha1-crowb60wXWfEgWNIpGmaQimsi04=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1", + "contains-path": "0.1.0", + "debug": "2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "0.2.3", + "eslint-module-utils": "2.1.1", + "has": "1.0.1", + "lodash.cond": "4.5.2", + "minimatch": "3.0.4", + "pkg-up": "1.0.0" + }, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "2.0.2", + "isarray": "1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + } + } + }, + "eslint-plugin-node": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-4.2.3.tgz", + "integrity": "sha512-vIUQPuwbVYdz/CYnlTLsJrRy7iXHQjdEe5wz0XhhdTym3IInM/zZLlPf9nZ2mThsH0QcsieCOWs2vOeCy/22LQ==", + "dev": true, + "requires": { + "ignore": "3.3.5", + "minimatch": "3.0.4", + "object-assign": "4.1.1", + "resolve": "1.4.0", + "semver": "5.3.0" + }, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "resolve": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", + "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + } + } + }, + "eslint-plugin-promise": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz", + "integrity": "sha1-ePu2/+BHIBYnVp6FpsU3OvKmj8o=", + "dev": true + }, + "eslint-plugin-react": { + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz", + "integrity": "sha1-xUNb6wZ3ThLH2y9qut3L+QDNP3g=", + "dev": true, + "requires": { + "array.prototype.find": "2.0.4", + "doctrine": "1.5.0", + "has": "1.0.1", + "jsx-ast-utils": "1.4.1", + "object.assign": "4.0.4" + }, + "dependencies": { + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "2.0.2", + "isarray": "1.0.0" + } + } + } + }, + "eslint-plugin-standard": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz", + "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=", + "dev": true + }, + "espree": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.1.tgz", + "integrity": "sha1-DJiLirRttTEAoZVK5LqZXd0n2H4=", + "dev": true, + "requires": { + "acorn": "5.1.2", + "acorn-jsx": "3.0.1" + } + }, + "esquery": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", + "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "dev": true, + "requires": { + "estraverse": "4.2.0", + "object-assign": "4.1.1" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.30" + } + }, + "exit": { + "version": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "exit-hook": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "1.2.2", + "object-assign": "4.1.1" + } + }, + "fileset": { + "version": "https://registry.npmjs.org/fileset/-/fileset-0.1.8.tgz", + "integrity": "sha1-UGuRqTluqn4y+0KoQHfHoMc2t0E=", + "dev": true, + "requires": { + "glob": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz" + } + }, + "find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "flat-cache": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", + "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", + "dev": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + } + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "fs-plus": { + "version": "https://registry.npmjs.org/fs-plus/-/fs-plus-2.9.2.tgz", + "integrity": "sha1-2eS1DC7icX7na042OZbju5vEQS4=", + "dev": true, + "requires": { + "async": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "tildify": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", + "underscore-plus": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.6.6.tgz" + } + }, + "fs.realpath": { + "version": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "gaze": { + "version": "https://registry.npmjs.org/gaze/-/gaze-0.3.4.tgz", + "integrity": "sha1-X5S92gr+U7xxCWm81vKCVI1gwnk=", + "dev": true, + "requires": { + "fileset": "https://registry.npmjs.org/fileset/-/fileset-0.1.8.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz" + } + }, + "generate-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", + "dev": true + }, + "generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true, + "requires": { + "is-property": "1.0.2" + } + }, + "get-stdin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", + "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", + "dev": true + }, + "glob": { + "version": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", + "dev": true, + "requires": { + "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz" + }, + "dependencies": { + "inherits": { + "version": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", + "dev": true + } + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimatch": "3.0.4", + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + } + } + }, + "graceful-fs": { + "version": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", + "dev": true + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "ignore": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.5.tgz", + "integrity": "sha512-JLH93mL8amZQhh/p6mfQgVBH3M6epNq3DfsXsTSuSrInVjwyYlFE1nv2AgfRCC8PoOhM0jwQ5v8s9LgbK7yGDw==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", + "integrity": "sha1-2zIEzVqd4ubNiQuFxuL2a89PYgo=", + "dev": true, + "requires": { + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + } + }, + "inherits": { + "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inquirer": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", + "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", + "dev": true, + "requires": { + "ansi-escapes": "1.4.0", + "ansi-regex": "2.1.1", + "chalk": "1.1.3", + "cli-cursor": "1.0.2", + "cli-width": "2.2.0", + "figures": "1.7.0", + "lodash": "4.17.4", + "readline2": "1.0.1", + "run-async": "0.1.0", + "rx-lite": "3.1.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "through": "2.3.8" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "interpret": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.4.tgz", + "integrity": "sha1-ggzdWIuGj/sZGoCVBtbJyPISsbA=", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-callable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "dev": true + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-my-json-valid": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz", + "integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==", + "dev": true, + "requires": { + "generate-function": "2.0.0", + "generate-object-property": "1.2.0", + "jsonpointer": "4.0.1", + "xtend": "4.0.1" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, + "requires": { + "is-path-inside": "1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", + "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "1.0.1" + } + }, + "is-resolvable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", + "integrity": "sha1-jfV8YeouPFAUCNEA+wE8+NbgzGI=", + "dev": true, + "requires": { + "tryit": "1.0.3" + } + }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "jasmine": { + "version": "https://registry.npmjs.org/jasmine/-/jasmine-2.5.2.tgz", + "integrity": "sha1-YoPO9whcCVzCXWUelU3wBPfj5CE=", + "dev": true, + "requires": { + "exit": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "glob": "https://registry.npmjs.org/glob/-/glob-7.1.0.tgz", + "jasmine-core": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.5.2.tgz" + }, + "dependencies": { + "glob": { + "version": "https://registry.npmjs.org/glob/-/glob-7.1.0.tgz", + "integrity": "sha1-Nq3YVtdG0NmeTMJ5e7oa4sZycv0=", + "dev": true, + "requires": { + "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + } + }, + "minimatch": { + "version": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", + "dev": true, + "requires": { + "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + } + } + } + }, + "jasmine-core": { + "version": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.5.2.tgz", + "integrity": "sha1-b2G9eQYeJ/Q+b5NV5Es8bKtv8pc=", + "dev": true + }, + "jasmine-focused": { + "version": "https://registry.npmjs.org/jasmine-focused/-/jasmine-focused-1.0.7.tgz", + "integrity": "sha1-uDx1fIAOaOHW78GjoaE/85/23NI=", + "dev": true, + "requires": { + "jasmine-node": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", + "underscore-plus": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.6.6.tgz", + "walkdir": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.7.tgz" + } + }, + "jasmine-node": { + "version": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", + "integrity": "sha1-rgu0p9GrhzYXjZ3WqvF/H3Tyj14=", + "dev": true, + "requires": { + "coffee-script": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", + "coffeestack": "https://registry.npmjs.org/coffeestack/-/coffeestack-1.1.2.tgz", + "gaze": "https://registry.npmjs.org/gaze/-/gaze-0.3.4.tgz", + "jasmine-reporters": "https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.2.0.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "requirejs": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.2.tgz", + "underscore": "https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz", + "walkdir": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.7.tgz" + } + }, + "jasmine-reporters": { + "version": "https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.2.0.tgz", + "integrity": "sha1-6MeRbfPkKDvIgpo/whFA6zIvils=", + "dev": true, + "requires": { + "jasmine": "https://registry.npmjs.org/jasmine/-/jasmine-2.5.2.tgz", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "xmldom": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.22.tgz" + }, + "dependencies": { + "mkdirp": { + "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + } + } + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonpointer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "dev": true + }, + "jsx-ast-utils": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz", + "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + } + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "lodash.cond": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", + "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", + "dev": true + }, + "lru-cache": { + "version": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, + "minimatch": { + "version": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "sigmund": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz" + } + }, + "minimist": { + "version": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", + "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", + "dev": true + }, + "nan": { + "version": "https://registry.npmjs.org/nan/-/nan-2.4.0.tgz", + "integrity": "sha1-+zxZ1F/k7/4hXwuJD4rfbrMtIjI=" + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "dev": true + }, + "object.assign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.0.4.tgz", + "integrity": "sha1-scnMBE7xuf5jYG/BQau7MuFHMMw=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "function-bind": "1.1.1", + "object-keys": "1.0.11" + } + }, + "once": { + "version": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "os-homedir": { + "version": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "p-limit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", + "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=", + "dev": true + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.1.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pkg-conf": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.0.0.tgz", + "integrity": "sha1-BxyHZQQDvM+5xif1h1G/5HwGcnk=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "load-json-file": "2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + } + } + }, + "pkg-config": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pkg-config/-/pkg-config-1.1.1.tgz", + "integrity": "sha1-VX7yLXPaPIg3EHdmxS6tq94pj+Q=", + "dev": true, + "requires": { + "debug-log": "1.0.1", + "find-root": "1.1.0", + "xtend": "4.0.1" + } + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true, + "requires": { + "find-up": "1.1.2" + } + }, + "pkg-up": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-1.0.0.tgz", + "integrity": "sha1-Pgj7RhUlxEIWJKM7n35tCvWwWiY=", + "dev": true, + "requires": { + "find-up": "1.1.2" + } + }, + "pluralize": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", + "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "progress": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "readline2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", + "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "mute-stream": "0.0.5" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "1.4.0" + }, + "dependencies": { + "resolve": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", + "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + } + } + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "requirejs": { + "version": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.2.tgz", + "integrity": "sha1-DqqHDUx9s7Fd0TIua2WwOI/EssY=", + "dev": true + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "1.1.1", + "onetime": "1.1.0" + } + }, + "rimraf": { + "version": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=", + "dev": true + }, + "run-async": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", + "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", + "dev": true, + "requires": { + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + } + }, + "run-parallel": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.6.tgz", + "integrity": "sha1-KQA8miFj4B4tLfyQV18sbB1hoDk=", + "dev": true + }, + "rx-lite": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", + "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true + }, + "shelljs": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", + "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", + "dev": true, + "requires": { + "glob": "7.1.2", + "interpret": "1.0.4", + "rechoir": "0.6.2" + }, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimatch": "3.0.4", + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + } + } + }, + "sigmund": { + "version": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + "slice-ansi": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", + "dev": true + }, + "source-map": { + "version": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "requires": { + "amdefine": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "standard": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/standard/-/standard-10.0.3.tgz", + "integrity": "sha512-JURZ+85ExKLQULckDFijdX5WHzN6RC7fgiZNSV4jFQVo+3tPoQGHyBrGekye/yf0aOfb4210EM5qPNlc2cRh4w==", + "dev": true, + "requires": { + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-config-standard-jsx": "4.0.2", + "eslint-plugin-import": "2.2.0", + "eslint-plugin-node": "4.2.3", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-react": "6.10.3", + "eslint-plugin-standard": "3.0.1", + "standard-engine": "7.0.0" + } + }, + "standard-engine": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-7.0.0.tgz", + "integrity": "sha1-67d7nI/CyBZf+jU72Rug3/Qa9pA=", + "dev": true, + "requires": { + "deglob": "2.1.0", + "get-stdin": "5.0.1", + "minimist": "1.2.0", + "pkg-conf": "2.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "table": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", + "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", + "dev": true, + "requires": { + "ajv": "4.11.8", + "ajv-keywords": "1.5.1", + "chalk": "1.1.3", + "lodash": "4.17.4", + "slice-ansi": "0.0.4", + "string-width": "2.1.1" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "temp": { + "version": "https://registry.npmjs.org/temp/-/temp-0.5.1.tgz", + "integrity": "sha1-d6sZx5qntZPL5PrCRBdoytmHuN8=", + "dev": true, + "requires": { + "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.1.4.tgz" + }, + "dependencies": { + "rimraf": { + "version": "https://registry.npmjs.org/rimraf/-/rimraf-2.1.4.tgz", + "integrity": "sha1-Wm62Lu2gaPUe3lDymz5c0i89m7I=", + "dev": true, + "requires": { + "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tildify": { + "version": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", + "integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=", + "dev": true, + "requires": { + "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" + } + }, + "tryit": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", + "integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "underscore": { + "version": "https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz", + "integrity": "sha1-EzXF5PXm0zu7SwBrqMhqAPVW3gg=", + "dev": true + }, + "underscore-plus": { + "version": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.6.6.tgz", + "integrity": "sha1-ZezeG9xEGjXYnmUP1w3PE65Dmn0=", + "dev": true, + "requires": { + "underscore": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz" + }, + "dependencies": { + "underscore": { + "version": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + } + } + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", + "dev": true + }, + "user-home": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", + "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", + "dev": true, + "requires": { + "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "walkdir": { + "version": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.7.tgz", + "integrity": "sha1-BNoCcKh6d4VAFzzb8KLbSZqNnik=", + "dev": true + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "wrench": { + "version": "https://registry.npmjs.org/wrench/-/wrench-1.4.4.tgz", + "integrity": "sha1-f1I+/bcbAQDnfc6DTAZSPL49VOA=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + } + } + } + }, + "xmldom": { + "version": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.22.tgz", + "integrity": "sha1-EN5OXpZJgfA8jMcvrcCNFLbDqiY=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } +} diff --git a/package.json b/package.json index 5e332cef..da837847 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.0.0", + "version": "5.0.1-0", "license": "MIT", "author": { "name": "Kevin Sawicki", From 9569681ae696325c55f221f558d068dfe0b50e2f Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 26 Sep 2017 22:18:16 -0700 Subject: [PATCH 138/194] :fire: trailing comma --- spec/async-spec-helper-functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/async-spec-helper-functions.js b/spec/async-spec-helper-functions.js index bc969536..850ba8e5 100644 --- a/spec/async-spec-helper-functions.js +++ b/spec/async-spec-helper-functions.js @@ -47,6 +47,6 @@ function waitsForPromise (promise, spec) { (e) => { spec.fail(e) done = true - }, + } ) } From cb48741711d35e48c8a4ba3ba1363639e171916b Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 27 Sep 2017 15:04:07 -0700 Subject: [PATCH 139/194] 5.1.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index feda876b..36d8ae97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.0.1-0", + "version": "5.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index da837847..70998530 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.0.1-0", + "version": "5.1.0", "license": "MIT", "author": { "name": "Kevin Sawicki", From 1001ce99922494d1e8b7bc3ed524fc463b4d122b Mon Sep 17 00:00:00 2001 From: Justin Ratner Date: Wed, 6 Dec 2017 15:35:23 -0700 Subject: [PATCH 140/194] Make the behavior of getHeadAsync consistent with getHead when repo has no commits --- package-lock.json | 223 ++++++++++++++---- spec/fixtures/no-commits.git/HEAD | 1 + spec/fixtures/no-commits.git/config | 7 + spec/fixtures/no-commits.git/description | 1 + .../hooks/applypatch-msg.sample | 15 ++ .../no-commits.git/hooks/commit-msg.sample | 24 ++ .../no-commits.git/hooks/post-update.sample | 8 + .../hooks/pre-applypatch.sample | 14 ++ .../no-commits.git/hooks/pre-commit.sample | 49 ++++ .../no-commits.git/hooks/pre-push.sample | 53 +++++ .../no-commits.git/hooks/pre-rebase.sample | 169 +++++++++++++ .../hooks/prepare-commit-msg.sample | 36 +++ .../no-commits.git/hooks/update.sample | 128 ++++++++++ spec/fixtures/no-commits.git/info/exclude | 6 + .../no-commits.git/objects/info/.gitkeep | 0 .../no-commits.git/objects/pack/.gitkeep | 0 .../no-commits.git/refs/heads/.gitkeep | 0 .../no-commits.git/refs/tags/.gitkeep | 0 spec/git-spec.js | 12 + src/repository.cc | 2 +- 20 files changed, 697 insertions(+), 51 deletions(-) create mode 100644 spec/fixtures/no-commits.git/HEAD create mode 100644 spec/fixtures/no-commits.git/config create mode 100644 spec/fixtures/no-commits.git/description create mode 100755 spec/fixtures/no-commits.git/hooks/applypatch-msg.sample create mode 100755 spec/fixtures/no-commits.git/hooks/commit-msg.sample create mode 100755 spec/fixtures/no-commits.git/hooks/post-update.sample create mode 100755 spec/fixtures/no-commits.git/hooks/pre-applypatch.sample create mode 100755 spec/fixtures/no-commits.git/hooks/pre-commit.sample create mode 100755 spec/fixtures/no-commits.git/hooks/pre-push.sample create mode 100755 spec/fixtures/no-commits.git/hooks/pre-rebase.sample create mode 100755 spec/fixtures/no-commits.git/hooks/prepare-commit-msg.sample create mode 100755 spec/fixtures/no-commits.git/hooks/update.sample create mode 100644 spec/fixtures/no-commits.git/info/exclude create mode 100644 spec/fixtures/no-commits.git/objects/info/.gitkeep create mode 100644 spec/fixtures/no-commits.git/objects/pack/.gitkeep create mode 100644 spec/fixtures/no-commits.git/refs/heads/.gitkeep create mode 100644 spec/fixtures/no-commits.git/refs/tags/.gitkeep diff --git a/package-lock.json b/package-lock.json index 36d8ae97..9dec169e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -91,11 +91,6 @@ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, - "async": { - "version": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", - "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", - "dev": true - }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", @@ -216,7 +211,6 @@ "dev": true, "requires": { "coffee-script": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.8.0.tgz", - "fs-plus": "https://registry.npmjs.org/fs-plus/-/fs-plus-2.9.2.tgz", "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz" }, "dependencies": { @@ -976,15 +970,132 @@ "dev": true }, "fs-plus": { - "version": "https://registry.npmjs.org/fs-plus/-/fs-plus-2.9.2.tgz", - "integrity": "sha1-2eS1DC7icX7na042OZbju5vEQS4=", - "dev": true, + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fs-plus/-/fs-plus-3.0.1.tgz", + "integrity": "sha1-VMFpxA4ohKZtNSeA0Y3TH5HToQ0=", "requires": { - "async": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", - "tildify": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", - "underscore-plus": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.6.6.tgz" + "async": "1.5.2", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "underscore-plus": "1.6.6" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "requires": { + "glob": "7.1.2" + } + }, + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=" + }, + "underscore-plus": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.6.6.tgz", + "integrity": "sha1-ZezeG9xEGjXYnmUP1w3PE65Dmn0=", + "requires": { + "underscore": "1.6.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + } } }, "fs.realpath": { @@ -1356,18 +1467,41 @@ "dev": true }, "jasmine-focused": { - "version": "https://registry.npmjs.org/jasmine-focused/-/jasmine-focused-1.0.7.tgz", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/jasmine-focused/-/jasmine-focused-1.0.7.tgz", "integrity": "sha1-uDx1fIAOaOHW78GjoaE/85/23NI=", "dev": true, "requires": { "jasmine-node": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", - "underscore-plus": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.6.6.tgz", - "walkdir": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.7.tgz" + "underscore-plus": "1.6.6", + "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", - "integrity": "sha1-rgu0p9GrhzYXjZ3WqvF/H3Tyj14=", "dev": true, "requires": { "coffee-script": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", @@ -1376,7 +1510,7 @@ "jasmine-reporters": "https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.2.0.tgz", "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", "requirejs": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.2.tgz", - "underscore": "https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz", + "underscore": "1.5.2", "walkdir": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.7.tgz" } }, @@ -1524,8 +1658,9 @@ "dev": true }, "nan": { - "version": "https://registry.npmjs.org/nan/-/nan-2.4.0.tgz", - "integrity": "sha1-+zxZ1F/k7/4hXwuJD4rfbrMtIjI=" + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", + "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=" }, "natural-compare": { "version": "1.4.0", @@ -2102,19 +2237,28 @@ } }, "temp": { - "version": "https://registry.npmjs.org/temp/-/temp-0.5.1.tgz", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.5.1.tgz", "integrity": "sha1-d6sZx5qntZPL5PrCRBdoytmHuN8=", "dev": true, "requires": { - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.1.4.tgz" + "rimraf": "2.1.4" }, "dependencies": { + "graceful-fs": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", + "dev": true, + "optional": true + }, "rimraf": { - "version": "https://registry.npmjs.org/rimraf/-/rimraf-2.1.4.tgz", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.1.4.tgz", "integrity": "sha1-Wm62Lu2gaPUe3lDymz5c0i89m7I=", "dev": true, "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz" + "graceful-fs": "1.2.3" } } } @@ -2131,14 +2275,6 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, - "tildify": { - "version": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", - "integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=", - "dev": true, - "requires": { - "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" - } - }, "tryit": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", @@ -2161,25 +2297,11 @@ "dev": true }, "underscore": { - "version": "https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz", "integrity": "sha1-EzXF5PXm0zu7SwBrqMhqAPVW3gg=", "dev": true }, - "underscore-plus": { - "version": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.6.6.tgz", - "integrity": "sha1-ZezeG9xEGjXYnmUP1w3PE65Dmn0=", - "dev": true, - "requires": { - "underscore": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz" - }, - "dependencies": { - "underscore": { - "version": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", - "dev": true - } - } - }, "uniq": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", @@ -2218,7 +2340,8 @@ "dev": true }, "wrench": { - "version": "https://registry.npmjs.org/wrench/-/wrench-1.4.4.tgz", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/wrench/-/wrench-1.4.4.tgz", "integrity": "sha1-f1I+/bcbAQDnfc6DTAZSPL49VOA=", "dev": true }, diff --git a/spec/fixtures/no-commits.git/HEAD b/spec/fixtures/no-commits.git/HEAD new file mode 100644 index 00000000..cb089cd8 --- /dev/null +++ b/spec/fixtures/no-commits.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/spec/fixtures/no-commits.git/config b/spec/fixtures/no-commits.git/config new file mode 100644 index 00000000..6c9406b7 --- /dev/null +++ b/spec/fixtures/no-commits.git/config @@ -0,0 +1,7 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true diff --git a/spec/fixtures/no-commits.git/description b/spec/fixtures/no-commits.git/description new file mode 100644 index 00000000..498b267a --- /dev/null +++ b/spec/fixtures/no-commits.git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/spec/fixtures/no-commits.git/hooks/applypatch-msg.sample b/spec/fixtures/no-commits.git/hooks/applypatch-msg.sample new file mode 100755 index 00000000..a5d7b84a --- /dev/null +++ b/spec/fixtures/no-commits.git/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/spec/fixtures/no-commits.git/hooks/commit-msg.sample b/spec/fixtures/no-commits.git/hooks/commit-msg.sample new file mode 100755 index 00000000..b58d1184 --- /dev/null +++ b/spec/fixtures/no-commits.git/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/spec/fixtures/no-commits.git/hooks/post-update.sample b/spec/fixtures/no-commits.git/hooks/post-update.sample new file mode 100755 index 00000000..ec17ec19 --- /dev/null +++ b/spec/fixtures/no-commits.git/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/spec/fixtures/no-commits.git/hooks/pre-applypatch.sample b/spec/fixtures/no-commits.git/hooks/pre-applypatch.sample new file mode 100755 index 00000000..4142082b --- /dev/null +++ b/spec/fixtures/no-commits.git/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/spec/fixtures/no-commits.git/hooks/pre-commit.sample b/spec/fixtures/no-commits.git/hooks/pre-commit.sample new file mode 100755 index 00000000..68d62d54 --- /dev/null +++ b/spec/fixtures/no-commits.git/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/spec/fixtures/no-commits.git/hooks/pre-push.sample b/spec/fixtures/no-commits.git/hooks/pre-push.sample new file mode 100755 index 00000000..6187dbf4 --- /dev/null +++ b/spec/fixtures/no-commits.git/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +z40=0000000000000000000000000000000000000000 + +while read local_ref local_sha remote_ref remote_sha +do + if [ "$local_sha" = $z40 ] + then + # Handle delete + : + else + if [ "$remote_sha" = $z40 ] + then + # New branch, examine all commits + range="$local_sha" + else + # Update to existing branch, examine new commits + range="$remote_sha..$local_sha" + fi + + # Check for WIP commit + commit=`git rev-list -n 1 --grep '^WIP' "$range"` + if [ -n "$commit" ] + then + echo >&2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/spec/fixtures/no-commits.git/hooks/pre-rebase.sample b/spec/fixtures/no-commits.git/hooks/pre-rebase.sample new file mode 100755 index 00000000..9773ed4c --- /dev/null +++ b/spec/fixtures/no-commits.git/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up-to-date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +exit 0 + +################################################################ + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". diff --git a/spec/fixtures/no-commits.git/hooks/prepare-commit-msg.sample b/spec/fixtures/no-commits.git/hooks/prepare-commit-msg.sample new file mode 100755 index 00000000..f093a02e --- /dev/null +++ b/spec/fixtures/no-commits.git/hooks/prepare-commit-msg.sample @@ -0,0 +1,36 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first comments out the +# "Conflicts:" part of a merge commit. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +case "$2,$3" in + merge,) + /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$1" ;; + + *) ;; +esac + +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/spec/fixtures/no-commits.git/hooks/update.sample b/spec/fixtures/no-commits.git/hooks/update.sample new file mode 100755 index 00000000..80ba9413 --- /dev/null +++ b/spec/fixtures/no-commits.git/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to block unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --bool hooks.allowunannotated) +allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +denycreatebranch=$(git config --bool hooks.denycreatebranch) +allowdeletetag=$(git config --bool hooks.allowdeletetag) +allowmodifytag=$(git config --bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then + newrev_type=delete +else + newrev_type=$(git cat-file -t $newrev) +fi + +case "$refname","$newrev_type" in + refs/tags/*,commit) + # un-annotated tag + short_refname=${refname##refs/tags/} + if [ "$allowunannotated" != "true" ]; then + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/spec/fixtures/no-commits.git/info/exclude b/spec/fixtures/no-commits.git/info/exclude new file mode 100644 index 00000000..a5196d1b --- /dev/null +++ b/spec/fixtures/no-commits.git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/spec/fixtures/no-commits.git/objects/info/.gitkeep b/spec/fixtures/no-commits.git/objects/info/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/no-commits.git/objects/pack/.gitkeep b/spec/fixtures/no-commits.git/objects/pack/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/no-commits.git/refs/heads/.gitkeep b/spec/fixtures/no-commits.git/refs/heads/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/no-commits.git/refs/tags/.gitkeep b/spec/fixtures/no-commits.git/refs/tags/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/spec/git-spec.js b/spec/git-spec.js index bbd6ee94..2ebff2dd 100644 --- a/spec/git-spec.js +++ b/spec/git-spec.js @@ -77,6 +77,18 @@ describe('git', () => { expect(await repo.getHeadAsync()).toBe('50719ab369dcbbc2fb3b7a0167c52accbd0eb40e') }) }) + + describe('when repo has no commits', () => { + it('returns null', () => { + repo = git.open(path.join(__dirname, 'fixtures/no-commits.git')) + expect(repo.getHead()).toBe(null) + }) + + it('resolves with null', async () => { + repo = git.open(path.join(__dirname, 'fixtures/no-commits.git')) + expect(await repo.getHeadAsync()).toBe(null) + }) + }) }) describe('.getShortHead()', () => { diff --git a/src/repository.cc b/src/repository.cc index a570bbc7..8842f00b 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -214,7 +214,7 @@ class HeadWorker : public Nan::AsyncWorker { std::pair, Local> Finish() { if (result.empty()) { - return {Nan::Error("Git head failed"), Nan::Null()}; + return {Nan::Null(), Nan::Null()}; } else { return {Nan::Null(), Nan::New(result).ToLocalChecked()}; } From 71c3d68658d8c019f15f2c5447fc0e3e5ac51544 Mon Sep 17 00:00:00 2001 From: Justin Ratner Date: Fri, 8 Dec 2017 13:39:46 -0700 Subject: [PATCH 141/194] 5.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 70998530..de7f8460 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.1.0", + "version": "5.2.0", "license": "MIT", "author": { "name": "Kevin Sawicki", From 90dca7eb5b359dffa7c19f9357bde63245f502c4 Mon Sep 17 00:00:00 2001 From: Vicente Canales Date: Tue, 9 Jan 2018 14:56:43 -0300 Subject: [PATCH 142/194] meta: manually manage submodules --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index a69704d5..4dd9b582 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,10 @@ node_js: 6 git: depth: 10 + submodules: false + +before_install: + - git submodule update --init branches: only: From e905f45bacbbf7e9948671a6e679785db05f1c61 Mon Sep 17 00:00:00 2001 From: Vicente Canales Date: Tue, 9 Jan 2018 15:09:33 -0300 Subject: [PATCH 143/194] move MTIMESPEC flag to mac definition --- binding.gyp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/binding.gyp b/binding.gyp index 89ddb1b5..b749829e 100644 --- a/binding.gyp +++ b/binding.gyp @@ -40,7 +40,6 @@ 'type': 'static_library', 'defines': [ 'GIT_THREADS', - 'GIT_USE_STAT_MTIMESPEC', # Node's util.h may be accidentally included so use this to guard # against compilation error. 'SRC_UTIL_H_', @@ -303,6 +302,12 @@ 'deps/libgit2/src/hash/hash_openssl.h', ], 'conditions': [ + ['OS=="mac"', { + 'defines': [ + 'GIT_SECURE_TRANSPORT', + 'GIT_USE_STAT_MTIMESPEC' + ], + }], ['OS=="linux"', { 'cflags': [ '-w', From 3f96930f4da21b4acc895d117e66ef2b877c18a2 Mon Sep 17 00:00:00 2001 From: Vicente Canales Date: Tue, 9 Jan 2018 15:16:23 -0300 Subject: [PATCH 144/194] add MTIM definition for linux --- binding.gyp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index b749829e..23b6e8f5 100644 --- a/binding.gyp +++ b/binding.gyp @@ -304,14 +304,16 @@ 'conditions': [ ['OS=="mac"', { 'defines': [ - 'GIT_SECURE_TRANSPORT', 'GIT_USE_STAT_MTIMESPEC' ], }], - ['OS=="linux"', { + ['OS=="linux" or OS.endswith("bsd")', { 'cflags': [ '-w', ], + 'defines': [ + 'GIT_USE_STAT_MTIM' + ] }], ['OS=="win"', { 'defines': [ From 9ab5d7d7343a62e33442f4e98ae0cba1fce825b9 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 18 Jan 2018 15:59:40 -0800 Subject: [PATCH 145/194] Avoid using async worker subclasses synchronously --- src/repository.cc | 104 +++++++++++++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 39 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index 8842f00b..103e2ba0 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -190,7 +190,7 @@ NAN_METHOD(Repository::GetSubmodulePaths) { info.GetReturnValue().Set(v8Paths); } -class HeadWorker : public Nan::AsyncWorker { +class HeadWorker { git_repository *repository; std::string result; @@ -220,25 +220,33 @@ class HeadWorker : public Nan::AsyncWorker { } } - void HandleOKCallback() { - auto result = Finish(); - Local argv[] = {result.first, result.second}; - callback->Call(2, argv); - } - - HeadWorker(Nan::Callback *callback, git_repository *repository) - : Nan::AsyncWorker(callback), repository(repository) {} + HeadWorker(git_repository *repository) : repository(repository) {} }; NAN_METHOD(Repository::GetHead) { - HeadWorker worker(NULL, GetRepository(info)); + HeadWorker worker(GetRepository(info)); worker.Execute(); info.GetReturnValue().Set(worker.Finish().second); } NAN_METHOD(Repository::GetHeadAsync) { + class HeadAsyncWorker : public Nan::AsyncWorker { + HeadWorker worker; + + public: + void Execute () { worker.Execute(); } + + void HandleOKCallback() { + auto result = worker.Finish(); + Local argv[] = {result.first, result.second}; + callback->Call(2, argv); + } + + HeadAsyncWorker(Nan::Callback *callback, git_repository *repository) : Nan::AsyncWorker(callback), worker(repository) {} + }; + auto callback = new Nan::Callback(Local::Cast(info[0])); - Nan::AsyncQueueWorker(new HeadWorker(callback, GetAsyncRepository(info))); + Nan::AsyncQueueWorker(new HeadAsyncWorker(callback, GetAsyncRepository(info))); } NAN_METHOD(Repository::RefreshIndex) { @@ -335,7 +343,7 @@ static int StatusCallback(const char* path, unsigned int status, void* payload) return GIT_OK; } -class StatusWorker : public Nan::AsyncWorker { +class StatusWorker { git_repository *repository; std::map statuses; char **paths; @@ -346,14 +354,11 @@ class StatusWorker : public Nan::AsyncWorker { void Execute() { git_status_options options = GIT_STATUS_OPTIONS_INIT; options.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS; - if (paths) { options.pathspec.count = path_count; options.pathspec.strings = paths; } - code = git_status_foreach_ext(repository, &options, StatusCallback, &statuses); - if (paths) { git_strarray_free(&options.pathspec); } @@ -374,16 +379,7 @@ class StatusWorker : public Nan::AsyncWorker { } } - void HandleOKCallback() { - auto result = Finish(); - Local argv[] = {result.first, result.second}; - callback->Call(2, argv); - } - - StatusWorker(Nan::Callback *callback, git_repository *repository, Local path_filter) - : Nan::AsyncWorker(callback), - repository(repository) { - + StatusWorker(git_repository *repository, Local path_filter) : repository{repository} { if (path_filter->IsArray()) { Local js_paths = Local::Cast(path_filter); path_count = js_paths->Length(); @@ -401,14 +397,32 @@ class StatusWorker : public Nan::AsyncWorker { }; NAN_METHOD(Repository::GetStatusAsync) { + class StatusAsyncWorker : public Nan::AsyncWorker { + StatusWorker worker; + + public: + void Execute() { + worker.Execute(); + } + + void HandleOKCallback() { + auto result = worker.Finish(); + Local argv[] = {result.first, result.second}; + callback->Call(2, argv); + } + + StatusAsyncWorker(Nan::Callback *callback, git_repository *repository, Local path_filter) + : Nan::AsyncWorker(callback), worker(repository, path_filter) {} + }; + auto callback = new Nan::Callback(Local::Cast(info[0])); Local path_filter = info.Length() > 1 ? info[1] : Local::Cast(Nan::Null()); - Nan::AsyncQueueWorker(new StatusWorker(callback, GetAsyncRepository(info), path_filter)); + Nan::AsyncQueueWorker(new StatusAsyncWorker(callback, GetAsyncRepository(info), path_filter)); } NAN_METHOD(Repository::GetStatus) { Local path_filter = info.Length() > 0 ? info[0] : Local::Cast(Nan::Null()); - StatusWorker worker(NULL, GetRepository(info), path_filter); + StatusWorker worker(GetRepository(info), path_filter); worker.Execute(); auto result = worker.Finish(); if (result.first->IsNull()) { @@ -668,7 +682,7 @@ unsigned GetCommitCount(git_repository *repository, git_oid *left_oid, git_oid * return result; } -class CompareCommitsWorker : public Nan::AsyncWorker { +class CompareCommitsWorker { git_repository *repository; std::string left_id; std::string right_id; @@ -697,15 +711,8 @@ class CompareCommitsWorker : public Nan::AsyncWorker { return {Nan::Null(), result}; } - void HandleOKCallback() { - auto result = Finish(); - Local argv[] = {result.first, result.second}; - callback->Call(2, argv); - } - - CompareCommitsWorker(Nan::Callback *callback, git_repository *repository, - Local js_left_id, Local js_right_id) - : Nan::AsyncWorker(callback), repository(repository) { + CompareCommitsWorker(git_repository *repository, Local js_left_id, + Local js_right_id) : repository(repository) { left_id = *String::Utf8Value(js_left_id); right_id = *String::Utf8Value(js_right_id); } @@ -717,19 +724,38 @@ NAN_METHOD(Repository::CompareCommits) { return; } - CompareCommitsWorker worker(NULL, GetRepository(info), info[0], info[1]); + CompareCommitsWorker worker(GetRepository(info), info[0], info[1]); worker.Execute(); info.GetReturnValue().Set(worker.Finish().second); } NAN_METHOD(Repository::CompareCommitsAsync) { + class CompareCommitsAsyncWorker : public Nan::AsyncWorker { + CompareCommitsWorker worker; + + public: + void Execute() { + worker.Execute(); + } + + void HandleOKCallback() { + auto result = worker.Finish(); + Local argv[] = {result.first, result.second}; + callback->Call(2, argv); + } + + CompareCommitsAsyncWorker(Nan::Callback *callback, git_repository *repository, + Local js_left_id, Local js_right_id) + : Nan::AsyncWorker(callback), worker(repository, js_left_id, js_right_id) {} + }; + if (info.Length() < 2) { info.GetReturnValue().Set(Nan::Null()); return; } auto callback = new Nan::Callback(Local::Cast(info[0])); - Nan::AsyncQueueWorker(new CompareCommitsWorker(callback, GetAsyncRepository(info), info[1], info[2])); + Nan::AsyncQueueWorker(new CompareCommitsAsyncWorker(callback, GetAsyncRepository(info), info[1], info[2])); } int Repository::DiffHunkCallback(const git_diff_delta* delta, From 2ad303ce5280dde24245c4ee247a61e839a5e892 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 18 Jan 2018 16:04:17 -0800 Subject: [PATCH 146/194] 5.2.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9dec169e..0da64766 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.1.0", + "version": "5.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index de7f8460..7dce0ae2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.2.0", + "version": "5.2.1", "license": "MIT", "author": { "name": "Kevin Sawicki", From a814fc33c3e9d840b8069ec1a3da69bf741a28e0 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 20 Feb 2018 13:35:55 -0800 Subject: [PATCH 147/194] 5.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7dce0ae2..5e74d990 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.2.1", + "version": "5.3.0", "license": "MIT", "author": { "name": "Kevin Sawicki", From 2e49d5cbc0a4c23cc4565136b062d30fcd1658aa Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 20 Feb 2018 14:09:05 -0800 Subject: [PATCH 148/194] Add appveyor.yml --- appveyor.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..ad2f646a --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,21 @@ +version: "{build}" + +platform: x64 + +branches: + only: + - master + +clone_depth: 10 + +skip_tags: true + +install: + - git submodule update --init + - ps: Install-Product node 6 + - npm install + +build: off +test: off +deploy: off + From 256887211ad6252695c59299ec54f1810b69dfe4 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 20 Feb 2018 14:30:20 -0800 Subject: [PATCH 149/194] Add missing source files to libgit2 build --- binding.gyp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/binding.gyp b/binding.gyp index 23b6e8f5..de7befb0 100644 --- a/binding.gyp +++ b/binding.gyp @@ -113,7 +113,7 @@ 'deps/libgit2/src/diff_parse.h', 'deps/libgit2/src/diff_stats.c', 'deps/libgit2/src/diff_tform.c', - 'deps/libgit2/src/diff_tform.c', + 'deps/libgit2/src/diff_tform.h', 'deps/libgit2/src/diff_xdiff.c', 'deps/libgit2/src/diff_xdiff.h', 'deps/libgit2/src/errors.c', @@ -143,6 +143,7 @@ 'deps/libgit2/src/index.c', 'deps/libgit2/src/index.h', 'deps/libgit2/src/indexer.c', + 'deps/libgit2/src/indexer.h', 'deps/libgit2/src/integer.h', 'deps/libgit2/src/iterator.c', 'deps/libgit2/src/iterator.h', @@ -263,6 +264,8 @@ 'deps/libgit2/src/userdiff.h', 'deps/libgit2/src/util.c', 'deps/libgit2/src/util.h', + 'deps/libgit2/src/varint.c', + 'deps/libgit2/src/varint.h', 'deps/libgit2/src/vector.c', 'deps/libgit2/src/vector.h', 'deps/libgit2/src/worktree.c', From 900ac53479a1aa8890cf5285371c251727177a3d Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 20 Feb 2018 14:41:33 -0800 Subject: [PATCH 150/194] 5.3.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5e74d990..93cafc1f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.3.0", + "version": "5.3.1", "license": "MIT", "author": { "name": "Kevin Sawicki", From 350b60d676d6aede90c9315b66c69b52cc532b77 Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Tue, 3 Apr 2018 13:13:36 +0300 Subject: [PATCH 151/194] Upgrade to libgit2 v0.27.0 This should fix many .gitignore handling related issues. --- binding.gyp | 58 ++++++++++++++++++++++++++++++++-------------------- deps/libgit2 | 2 +- 2 files changed, 37 insertions(+), 23 deletions(-) diff --git a/binding.gyp b/binding.gyp index de7befb0..da4aec11 100644 --- a/binding.gyp +++ b/binding.gyp @@ -40,6 +40,7 @@ 'type': 'static_library', 'defines': [ 'GIT_THREADS', + 'LIBGIT2_NO_FEATURES_H', # Node's util.h may be accidentally included so use this to guard # against compilation error. 'SRC_UTIL_H_', @@ -49,10 +50,10 @@ 'http_parser', ], 'sources': [ - 'deps/libgit2/src/apply.h', - 'deps/libgit2/src/apply.c', 'deps/libgit2/src/annotated_commit.c', 'deps/libgit2/src/annotated_commit.h', + 'deps/libgit2/src/apply.c', + 'deps/libgit2/src/apply.h', 'deps/libgit2/src/array.h', 'deps/libgit2/src/attr.c', 'deps/libgit2/src/attr.h', @@ -91,14 +92,12 @@ 'deps/libgit2/src/config_cache.c', 'deps/libgit2/src/config_file.c', 'deps/libgit2/src/config_file.h', + 'deps/libgit2/src/config_parse.c', + 'deps/libgit2/src/config_parse.h', 'deps/libgit2/src/crlf.c', - 'deps/libgit2/src/curl_stream.c', - 'deps/libgit2/src/curl_stream.h', 'deps/libgit2/src/date.c', 'deps/libgit2/src/delta.c', 'deps/libgit2/src/delta.h', - 'deps/libgit2/src/delta.c', - 'deps/libgit2/src/delta.h', 'deps/libgit2/src/describe.c', 'deps/libgit2/src/diff.c', 'deps/libgit2/src/diff.h', @@ -108,9 +107,9 @@ 'deps/libgit2/src/diff_file.h', 'deps/libgit2/src/diff_generate.c', 'deps/libgit2/src/diff_generate.h', - 'deps/libgit2/src/diff_print.c', 'deps/libgit2/src/diff_parse.c', 'deps/libgit2/src/diff_parse.h', + 'deps/libgit2/src/diff_print.c', 'deps/libgit2/src/diff_stats.c', 'deps/libgit2/src/diff_tform.c', 'deps/libgit2/src/diff_tform.h', @@ -149,10 +148,10 @@ 'deps/libgit2/src/iterator.h', 'deps/libgit2/src/khash.h', 'deps/libgit2/src/map.h', - 'deps/libgit2/src/merge_driver.c', - 'deps/libgit2/src/merge_driver.h', 'deps/libgit2/src/merge.c', 'deps/libgit2/src/merge.h', + 'deps/libgit2/src/merge_driver.c', + 'deps/libgit2/src/merge_driver.h', 'deps/libgit2/src/merge_file.c', 'deps/libgit2/src/message.c', 'deps/libgit2/src/message.h', @@ -170,24 +169,26 @@ 'deps/libgit2/src/odb_loose.c', 'deps/libgit2/src/odb_mempack.c', 'deps/libgit2/src/odb_pack.c', - 'deps/libgit2/src/offmap.h', 'deps/libgit2/src/offmap.c', + 'deps/libgit2/src/offmap.h', 'deps/libgit2/src/oid.c', 'deps/libgit2/src/oid.h', 'deps/libgit2/src/oidarray.c', 'deps/libgit2/src/oidarray.h', - 'deps/libgit2/src/oidmap.h', 'deps/libgit2/src/oidmap.c', - 'deps/libgit2/src/openssl_stream.c', - 'deps/libgit2/src/openssl_stream.h', + 'deps/libgit2/src/oidmap.h', 'deps/libgit2/src/pack-objects.c', 'deps/libgit2/src/pack-objects.h', 'deps/libgit2/src/pack.c', 'deps/libgit2/src/pack.h', + 'deps/libgit2/src/parse.c', + 'deps/libgit2/src/parse.h', 'deps/libgit2/src/patch.c', 'deps/libgit2/src/patch.h', 'deps/libgit2/src/patch_generate.c', 'deps/libgit2/src/patch_generate.h', + 'deps/libgit2/src/patch_parse.c', + 'deps/libgit2/src/patch_parse.h', 'deps/libgit2/src/path.c', 'deps/libgit2/src/path.h', 'deps/libgit2/src/pathspec.c', @@ -228,15 +229,11 @@ 'deps/libgit2/src/sha1_lookup.h', 'deps/libgit2/src/signature.c', 'deps/libgit2/src/signature.h', - 'deps/libgit2/src/socket_stream.c', - 'deps/libgit2/src/socket_stream.h', 'deps/libgit2/src/sortedcache.c', 'deps/libgit2/src/sortedcache.h', 'deps/libgit2/src/stash.c', 'deps/libgit2/src/status.c', 'deps/libgit2/src/status.h', - 'deps/libgit2/src/stransport_stream.c', - 'deps/libgit2/src/stransport_stream.h', 'deps/libgit2/src/stream.h', 'deps/libgit2/src/strmap.c', 'deps/libgit2/src/strmap.h', @@ -249,10 +246,9 @@ 'deps/libgit2/src/tag.h', 'deps/libgit2/src/thread-utils.c', 'deps/libgit2/src/thread-utils.h', - 'deps/libgit2/src/tls_stream.c', - 'deps/libgit2/src/tls_stream.h', 'deps/libgit2/src/trace.c', 'deps/libgit2/src/trace.h', + 'deps/libgit2/src/trailer.c', 'deps/libgit2/src/transaction.c', 'deps/libgit2/src/transaction.h', 'deps/libgit2/src/transport.c', @@ -272,18 +268,33 @@ 'deps/libgit2/src/worktree.h', 'deps/libgit2/src/zstream.c', 'deps/libgit2/src/zstream.h', + 'deps/libgit2/src/streams/curl.c', + 'deps/libgit2/src/streams/curl.h', + 'deps/libgit2/src/streams/openssl.c', + 'deps/libgit2/src/streams/openssl.h', + 'deps/libgit2/src/streams/socket.c', + 'deps/libgit2/src/streams/socket.h', + 'deps/libgit2/src/streams/stransport.c', + 'deps/libgit2/src/streams/stransport.h', + 'deps/libgit2/src/streams/tls.c', + 'deps/libgit2/src/streams/tls.h', 'deps/libgit2/src/transports/auth.c', + 'deps/libgit2/src/transports/auth.h', 'deps/libgit2/src/transports/auth_negotiate.c', + 'deps/libgit2/src/transports/auth_negotiate.h', 'deps/libgit2/src/transports/cred.c', + 'deps/libgit2/src/transports/cred.h', 'deps/libgit2/src/transports/cred_helpers.c', 'deps/libgit2/src/transports/git.c', 'deps/libgit2/src/transports/http.c', + 'deps/libgit2/src/transports/http.h', 'deps/libgit2/src/transports/local.c', 'deps/libgit2/src/transports/smart.c', 'deps/libgit2/src/transports/smart.h', 'deps/libgit2/src/transports/smart_pkt.c', 'deps/libgit2/src/transports/smart_protocol.c', 'deps/libgit2/src/transports/ssh.c', + 'deps/libgit2/src/transports/ssh.h', 'deps/libgit2/src/transports/winhttp.c', 'deps/libgit2/src/xdiff/xdiff.h', 'deps/libgit2/src/xdiff/xdiffi.c', @@ -302,7 +313,6 @@ 'deps/libgit2/src/xdiff/xutils.h', 'deps/libgit2/src/hash/hash_generic.c', 'deps/libgit2/src/hash/hash_generic.h', - 'deps/libgit2/src/hash/hash_openssl.h', ], 'conditions': [ ['OS=="mac"', { @@ -367,7 +377,6 @@ 'deps/libgit2/src/win32/error.h', 'deps/libgit2/src/win32/findfile.c', 'deps/libgit2/src/win32/findfile.h', - 'deps/libgit2/src/win32/git2.rc', 'deps/libgit2/src/win32/map.c', 'deps/libgit2/src/win32/mingw-compat.h', 'deps/libgit2/src/win32/msvc-compat.h', @@ -377,9 +386,9 @@ 'deps/libgit2/src/win32/posix_w32.c', 'deps/libgit2/src/win32/precompiled.c', 'deps/libgit2/src/win32/precompiled.h', + 'deps/libgit2/src/win32/reparse.h', 'deps/libgit2/src/win32/thread.c', 'deps/libgit2/src/win32/thread.h', - 'deps/libgit2/src/win32/reparse.h', 'deps/libgit2/src/win32/utf-conv.c', 'deps/libgit2/src/win32/utf-conv.h', 'deps/libgit2/src/win32/version.h', @@ -391,7 +400,9 @@ 'deps/libgit2/src/win32/w32_stack.h', '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': [ @@ -400,6 +411,7 @@ 'sources': [ 'deps/libgit2/src/unix/map.c', 'deps/libgit2/src/unix/posix.h', + 'deps/libgit2/src/unix/pthread.h', 'deps/libgit2/src/unix/realpath.c', ], 'cflags': [ @@ -436,6 +448,8 @@ 'deps/libgit2/deps/zlib/crc32.h', 'deps/libgit2/deps/zlib/deflate.c', 'deps/libgit2/deps/zlib/deflate.h', + 'deps/libgit2/deps/zlib/gzguts.h', + 'deps/libgit2/deps/zlib/infback.c', 'deps/libgit2/deps/zlib/inffast.c', 'deps/libgit2/deps/zlib/inffast.h', 'deps/libgit2/deps/zlib/inffixed.h', diff --git a/deps/libgit2 b/deps/libgit2 index 15e11937..6311e886 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit 15e119375018fba121cf58e02a9f17fe22df0df8 +Subproject commit 6311e886d8b5377c6037cd9937ccf66a71f3361d From fdc96ca367cc46593c0f0e548d30f2eb23e07a70 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 25 Apr 2018 10:23:36 -0400 Subject: [PATCH 152/194] Update package-lock.json --- package-lock.json | 125 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 114 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0da64766..638e6715 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.2.1", + "version": "5.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -170,7 +170,7 @@ "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", "dev": true }, "cli-cursor": { @@ -211,9 +211,26 @@ "dev": true, "requires": { "coffee-script": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.8.0.tgz", + "fs-plus": "2.10.1", "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz" }, "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } + }, "coffee-script": { "version": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.8.0.tgz", "integrity": "sha1-nJ8dK0pSoADe0Vtll5FwNkgmPB0=", @@ -221,6 +238,92 @@ "requires": { "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz" } + }, + "fs-plus": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/fs-plus/-/fs-plus-2.10.1.tgz", + "integrity": "sha1-MgR4HXhAYR5jZOe2+wWMljJ8WqU=", + "dev": true, + "requires": { + "async": "1.5.2", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "underscore-plus": "1.6.6" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "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" + } + } + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "inflight": "1.0.6", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "minimatch": "3.0.4", + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true } } }, @@ -264,7 +367,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -654,7 +757,7 @@ "eslint-config-standard-jsx": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-4.0.2.tgz", - "integrity": "sha512-F8fRh2WFnTek7dZH9ZaE0PCBwdVGkwVWZmizla/DDNOmg7Tx6B/IlK5+oYpiX29jpu73LszeJj5i1axEZv6VMw==", + "integrity": "sha1-AJ5TxN2x6e5wtGUP/mOn85+INuE=", "dev": true }, "eslint-import-resolver-node": { @@ -747,7 +850,7 @@ "eslint-plugin-node": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-4.2.3.tgz", - "integrity": "sha512-vIUQPuwbVYdz/CYnlTLsJrRy7iXHQjdEe5wz0XhhdTym3IInM/zZLlPf9nZ2mThsH0QcsieCOWs2vOeCy/22LQ==", + "integrity": "sha1-wEOQq428u2iHF0Aj1vOnJ2nmO5c=", "dev": true, "requires": { "ignore": "3.3.5", @@ -930,7 +1033,7 @@ "find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", + "integrity": "sha1-q8/Iunb3CMQql7PWhbfpRQv7nOQ=", "dev": true }, "find-up": { @@ -1106,7 +1209,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", "dev": true }, "gaze": { @@ -1159,7 +1262,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=", "dev": true }, "globby": { @@ -1981,7 +2084,7 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=", "dev": true }, "semver": { @@ -2070,7 +2173,7 @@ "standard": { "version": "10.0.3", "resolved": "https://registry.npmjs.org/standard/-/standard-10.0.3.tgz", - "integrity": "sha512-JURZ+85ExKLQULckDFijdX5WHzN6RC7fgiZNSV4jFQVo+3tPoQGHyBrGekye/yf0aOfb4210EM5qPNlc2cRh4w==", + "integrity": "sha1-eGm8v0Ir3uqraJof+x/qlnfdUOo=", "dev": true, "requires": { "eslint": "3.19.0", @@ -2201,7 +2304,7 @@ "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0", From 043824856a33ca3f695fb43ffd3018b6c2e26e34 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 25 Apr 2018 10:23:58 -0400 Subject: [PATCH 153/194] 5.4.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 638e6715..462167c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.3.1", + "version": "5.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 93cafc1f..804b6b5e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.3.1", + "version": "5.4.0", "license": "MIT", "author": { "name": "Kevin Sawicki", From 4d8865bd5b85660983e8bcc5ba71489daf574a0c Mon Sep 17 00:00:00 2001 From: Rafael Oleza Date: Wed, 20 Mar 2019 19:10:39 +0100 Subject: [PATCH 154/194] Upgrade libgit2 version Upgraded to the commit https://github.com/libgit2/libgit2/commit/9084712b555a876873bd7d7583f5befd47647c9d --- binding.gyp | 14 ++++++++++++-- deps/libgit2 | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/binding.gyp b/binding.gyp index da4aec11..153748de 100644 --- a/binding.gyp +++ b/binding.gyp @@ -54,6 +54,8 @@ 'deps/libgit2/src/annotated_commit.h', 'deps/libgit2/src/apply.c', 'deps/libgit2/src/apply.h', + 'deps/libgit2/src/alloc.c', + 'deps/libgit2/src/alloc.h', 'deps/libgit2/src/array.h', 'deps/libgit2/src/attr.c', 'deps/libgit2/src/attr.h', @@ -90,6 +92,8 @@ 'deps/libgit2/src/config.c', 'deps/libgit2/src/config.h', 'deps/libgit2/src/config_cache.c', + 'deps/libgit2/src/config_entries.c', + 'deps/libgit2/src/config_entries.h', 'deps/libgit2/src/config_file.c', 'deps/libgit2/src/config_file.h', 'deps/libgit2/src/config_parse.c', @@ -147,6 +151,8 @@ 'deps/libgit2/src/iterator.c', 'deps/libgit2/src/iterator.h', 'deps/libgit2/src/khash.h', + 'deps/libgit2/src/mailmap.c', + 'deps/libgit2/src/mailmap.h', 'deps/libgit2/src/map.h', 'deps/libgit2/src/merge.c', 'deps/libgit2/src/merge.h', @@ -234,6 +240,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/stream.h', 'deps/libgit2/src/strmap.c', 'deps/libgit2/src/strmap.h', @@ -268,8 +276,10 @@ 'deps/libgit2/src/worktree.h', 'deps/libgit2/src/zstream.c', 'deps/libgit2/src/zstream.h', - 'deps/libgit2/src/streams/curl.c', - 'deps/libgit2/src/streams/curl.h', + 'deps/libgit2/src/streams/registry.c', + 'deps/libgit2/src/streams/registry.h', + 'deps/libgit2/src/streams/mbedtls.c', + 'deps/libgit2/src/streams/mbedtls.h', 'deps/libgit2/src/streams/openssl.c', 'deps/libgit2/src/streams/openssl.h', 'deps/libgit2/src/streams/socket.c', diff --git a/deps/libgit2 b/deps/libgit2 index 6311e886..9084712b 160000 --- a/deps/libgit2 +++ b/deps/libgit2 @@ -1 +1 @@ -Subproject commit 6311e886d8b5377c6037cd9937ccf66a71f3361d +Subproject commit 9084712b555a876873bd7d7583f5befd47647c9d From afc8d8c5c75c0c6b6b3923e5c2a381cef24039fc Mon Sep 17 00:00:00 2001 From: Rafael Oleza Date: Thu, 21 Mar 2019 09:55:11 +0100 Subject: [PATCH 155/194] 5.5.0 Upgraded libgit2 to libgit2/libgit2@9084712 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 462167c2..504acb0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.4.0", + "version": "5.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 804b6b5e..32cacfd1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.4.0", + "version": "5.5.0", "license": "MIT", "author": { "name": "Kevin Sawicki", From 1c9311b383746cb4f0c3bca9c859c8c71c6e0b0e Mon Sep 17 00:00:00 2001 From: Rafael Oleza Date: Thu, 21 Mar 2019 10:10:37 +0100 Subject: [PATCH 156/194] Add AppVeyor badge to Readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e41c1a2..461ce7e5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# Git Node module [![Build Status](https://travis-ci.org/atom/git-utils.svg?branch=master)](https://travis-ci.org/atom/git-utils) +# Git Node module [![Build Status](https://travis-ci.org/atom/git-utils.svg?branch=master)](https://travis-ci.org/atom/git-utils) [![Build status](https://ci.appveyor.com/api/projects/status/myrqbxes1mv8b472?svg=true)](https://ci.appveyor.com/project/Atom/git-utils) + Helpers for working with Git repositories built natively on top of [libgit2](http://libgit2.github.com). From d06f64d39c4fbcc13ac4429ac9a904dcad90d3f1 Mon Sep 17 00:00:00 2001 From: Winston Liu <50Wliu@users.noreply.github.com> Date: Tue, 21 May 2019 13:49:28 -0400 Subject: [PATCH 157/194] Don't set win_delay_load_hook to false --- binding.gyp | 1 - 1 file changed, 1 deletion(-) diff --git a/binding.gyp b/binding.gyp index 153748de..ded6dc7f 100644 --- a/binding.gyp +++ b/binding.gyp @@ -2,7 +2,6 @@ 'targets': [ { 'target_name': 'git', - 'win_delay_load_hook': 'false', 'dependencies': [ 'libgit2' ], From c235108a2ba08e41046bcb826f9b74d5ac40f11f Mon Sep 17 00:00:00 2001 From: Winston Liu <50Wliu@users.noreply.github.com> Date: Tue, 21 May 2019 13:51:36 -0400 Subject: [PATCH 158/194] Update package-lock.json --- package-lock.json | 921 ++++++++++++++++++++++++---------------------- 1 file changed, 479 insertions(+), 442 deletions(-) diff --git a/package-lock.json b/package-lock.json index 504acb0d..0fdc34c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, "requires": { - "acorn": "3.3.0" + "acorn": "^3.0.4" }, "dependencies": { "acorn": { @@ -33,8 +33,8 @@ "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "dev": true, "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" } }, "ajv-keywords": { @@ -44,7 +44,8 @@ "dev": true }, "amdefine": { - "version": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz", "integrity": "sha1-/RdHRwDLXMnCtwnwvp0jzjwZjDM=", "dev": true }, @@ -66,7 +67,7 @@ "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { - "array-uniq": "1.0.3" + "array-uniq": "^1.0.1" } }, "array-uniq": { @@ -81,8 +82,8 @@ "integrity": "sha1-VWpcU2LAhkgyPdrrnenRS8GGTJA=", "dev": true, "requires": { - "define-properties": "1.1.2", - "es-abstract": "1.8.2" + "define-properties": "^1.1.2", + "es-abstract": "^1.7.0" } }, "arrify": { @@ -97,9 +98,9 @@ "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" }, "dependencies": { "ansi-styles": { @@ -114,11 +115,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "strip-ansi": { @@ -127,23 +128,25 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } } } }, "balanced-match": { - "version": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", "dev": true }, "brace-expansion": { - "version": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", "integrity": "sha1-cZfX6qm4fmSDkOph/GbIRCdCDfk=", "dev": true, "requires": { - "balanced-match": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "^0.4.1", + "concat-map": "0.0.1" } }, "builtin-modules": { @@ -158,7 +161,7 @@ "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", "dev": true, "requires": { - "callsites": "0.2.0" + "callsites": "^0.2.0" } }, "callsites": { @@ -179,7 +182,7 @@ "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", "dev": true, "requires": { - "restore-cursor": "1.0.1" + "restore-cursor": "^1.0.1" } }, "cli-width": { @@ -201,18 +204,20 @@ "dev": true }, "coffee-script": { - "version": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", "integrity": "sha1-FQ1rTLUiiUNp7+1qIQHCC8f0pPQ=", "dev": true }, "coffeestack": { - "version": "https://registry.npmjs.org/coffeestack/-/coffeestack-1.1.2.tgz", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/coffeestack/-/coffeestack-1.1.2.tgz", "integrity": "sha1-NSePO+uc5vXQraH7bgh4UrZXzpg=", "dev": true, "requires": { - "coffee-script": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.8.0.tgz", - "fs-plus": "2.10.1", - "source-map": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz" + "coffee-script": "~1.8.0", + "fs-plus": "^2.5.0", + "source-map": "~0.1.43" }, "dependencies": { "balanced-match": { @@ -227,16 +232,17 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "coffee-script": { - "version": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.8.0.tgz", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.8.0.tgz", "integrity": "sha1-nJ8dK0pSoADe0Vtll5FwNkgmPB0=", "dev": true, "requires": { - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz" + "mkdirp": "~0.3.5" } }, "fs-plus": { @@ -245,10 +251,10 @@ "integrity": "sha1-MgR4HXhAYR5jZOe2+wWMljJ8WqU=", "dev": true, "requires": { - "async": "1.5.2", - "mkdirp": "0.5.1", - "rimraf": "2.6.2", - "underscore-plus": "1.6.6" + "async": "^1.5.2", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.2", + "underscore-plus": "1.x" }, "dependencies": { "async": { @@ -263,7 +269,7 @@ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { - "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + "minimist": "0.0.8" } }, "rimraf": { @@ -272,7 +278,7 @@ "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "underscore-plus": { @@ -281,7 +287,7 @@ "integrity": "sha1-ZezeG9xEGjXYnmUP1w3PE65Dmn0=", "dev": true, "requires": { - "underscore": "1.6.0" + "underscore": "~1.6.0" } } } @@ -292,12 +298,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "inflight": "1.0.6", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "3.0.4", - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "inflight": { @@ -306,8 +312,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "once": "^1.3.0", + "wrappy": "1" } }, "minimatch": { @@ -316,7 +322,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "underscore": { @@ -328,7 +334,8 @@ } }, "concat-map": { - "version": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, @@ -338,9 +345,9 @@ "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", "dev": true, "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "readable-stream": "2.3.3", - "typedarray": "0.0.6" + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, "contains-path": { @@ -361,7 +368,7 @@ "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "dev": true, "requires": { - "es5-ext": "0.10.30" + "es5-ext": "^0.10.9" } }, "debug": { @@ -391,8 +398,8 @@ "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", "dev": true, "requires": { - "foreach": "2.0.5", - "object-keys": "1.0.11" + "foreach": "^2.0.5", + "object-keys": "^1.0.8" } }, "deglob": { @@ -401,12 +408,12 @@ "integrity": "sha1-TUSr4W7zLHebSXK9FBqAMlApoUo=", "dev": true, "requires": { - "find-root": "1.1.0", - "glob": "7.1.2", - "ignore": "3.3.5", - "pkg-config": "1.1.1", - "run-parallel": "1.1.6", - "uniq": "1.0.1" + "find-root": "^1.0.0", + "glob": "^7.0.5", + "ignore": "^3.0.9", + "pkg-config": "^1.1.0", + "run-parallel": "^1.1.2", + "uniq": "^1.0.1" }, "dependencies": { "balanced-match": { @@ -421,8 +428,8 @@ "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", "dev": true, "requires": { - "balanced-match": "1.0.0", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "glob": { @@ -431,12 +438,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "3.0.4", - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "minimatch": { @@ -445,7 +452,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "^1.1.7" } } } @@ -456,13 +463,13 @@ "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", "dev": true, "requires": { - "globby": "5.0.0", - "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.0", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "rimraf": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz" + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" } }, "doctrine": { @@ -471,8 +478,8 @@ "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", "dev": true, "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" + "esutils": "^2.0.2", + "isarray": "^1.0.0" } }, "error-ex": { @@ -481,7 +488,7 @@ "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", "dev": true, "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "es-abstract": { @@ -490,11 +497,11 @@ "integrity": "sha512-dvhwFL3yjQxNNsOWx6exMlaDrRHCRGMQlnx5lsXDCZ/J7G/frgIIl94zhZSp/galVAYp7VzPi1OrAHta89/yGQ==", "dev": true, "requires": { - "es-to-primitive": "1.1.1", - "function-bind": "1.1.1", - "has": "1.0.1", - "is-callable": "1.1.3", - "is-regex": "1.0.4" + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" } }, "es-to-primitive": { @@ -503,9 +510,9 @@ "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", "dev": true, "requires": { - "is-callable": "1.1.3", - "is-date-object": "1.0.1", - "is-symbol": "1.0.1" + "is-callable": "^1.1.1", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.1" } }, "es5-ext": { @@ -514,8 +521,8 @@ "integrity": "sha1-cUGhaDZpfbq/qq7uQUlc4p9SyTk=", "dev": true, "requires": { - "es6-iterator": "2.0.1", - "es6-symbol": "3.1.1" + "es6-iterator": "2", + "es6-symbol": "~3.1" } }, "es6-iterator": { @@ -524,9 +531,9 @@ "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.30", - "es6-symbol": "3.1.1" + "d": "1", + "es5-ext": "^0.10.14", + "es6-symbol": "^3.1" } }, "es6-map": { @@ -535,12 +542,12 @@ "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.30", - "es6-iterator": "2.0.1", - "es6-set": "0.1.5", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", + "es6-set": "~0.1.5", + "es6-symbol": "~3.1.1", + "event-emitter": "~0.3.5" } }, "es6-set": { @@ -549,11 +556,11 @@ "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.30", - "es6-iterator": "2.0.1", + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" + "event-emitter": "~0.3.5" } }, "es6-symbol": { @@ -562,8 +569,8 @@ "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.30" + "d": "1", + "es5-ext": "~0.10.14" } }, "es6-weak-map": { @@ -572,10 +579,10 @@ "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.30", - "es6-iterator": "2.0.1", - "es6-symbol": "3.1.1" + "d": "1", + "es5-ext": "^0.10.14", + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" } }, "escape-string-regexp": { @@ -590,10 +597,10 @@ "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", "dev": true, "requires": { - "es6-map": "0.1.5", - "es6-weak-map": "2.0.2", - "esrecurse": "4.2.0", - "estraverse": "4.2.0" + "es6-map": "^0.1.3", + "es6-weak-map": "^2.0.1", + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" } }, "eslint": { @@ -602,41 +609,41 @@ "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", "dev": true, "requires": { - "babel-code-frame": "6.26.0", - "chalk": "1.1.3", - "concat-stream": "1.6.0", - "debug": "2.6.9", - "doctrine": "2.0.0", - "escope": "3.6.0", - "espree": "3.5.1", - "esquery": "1.0.0", - "estraverse": "4.2.0", - "esutils": "2.0.2", - "file-entry-cache": "2.0.0", - "glob": "7.1.2", - "globals": "9.18.0", - "ignore": "3.3.5", - "imurmurhash": "0.1.4", - "inquirer": "0.12.0", - "is-my-json-valid": "2.16.1", - "is-resolvable": "1.0.0", - "js-yaml": "3.10.0", - "json-stable-stringify": "1.0.1", - "levn": "0.3.0", - "lodash": "4.17.4", - "mkdirp": "0.5.1", - "natural-compare": "1.4.0", - "optionator": "0.8.2", - "path-is-inside": "1.0.2", - "pluralize": "1.2.1", - "progress": "1.1.8", - "require-uncached": "1.0.3", - "shelljs": "0.7.8", - "strip-bom": "3.0.0", - "strip-json-comments": "2.0.1", - "table": "3.8.3", - "text-table": "0.2.0", - "user-home": "2.0.0" + "babel-code-frame": "^6.16.0", + "chalk": "^1.1.3", + "concat-stream": "^1.5.2", + "debug": "^2.1.1", + "doctrine": "^2.0.0", + "escope": "^3.6.0", + "espree": "^3.4.0", + "esquery": "^1.0.0", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "glob": "^7.0.3", + "globals": "^9.14.0", + "ignore": "^3.2.0", + "imurmurhash": "^0.1.4", + "inquirer": "^0.12.0", + "is-my-json-valid": "^2.10.0", + "is-resolvable": "^1.0.0", + "js-yaml": "^3.5.1", + "json-stable-stringify": "^1.0.0", + "levn": "^0.3.0", + "lodash": "^4.0.0", + "mkdirp": "^0.5.0", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.1", + "pluralize": "^1.2.1", + "progress": "^1.1.8", + "require-uncached": "^1.0.2", + "shelljs": "^0.7.5", + "strip-bom": "^3.0.0", + "strip-json-comments": "~2.0.1", + "table": "^3.7.8", + "text-table": "~0.2.0", + "user-home": "^2.0.0" }, "dependencies": { "ansi-styles": { @@ -651,7 +658,7 @@ "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "balanced-match": { @@ -666,8 +673,8 @@ "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", "dev": true, "requires": { - "balanced-match": "1.0.0", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "chalk": { @@ -676,11 +683,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "esprima": { @@ -695,12 +702,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "3.0.4", - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "js-yaml": { @@ -709,8 +716,8 @@ "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", "dev": true, "requires": { - "argparse": "1.0.9", - "esprima": "4.0.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "lodash": { @@ -725,7 +732,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "^1.1.7" } }, "mkdirp": { @@ -734,7 +741,7 @@ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { - "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + "minimist": "0.0.8" } }, "strip-ansi": { @@ -743,7 +750,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } } } @@ -766,9 +773,9 @@ "integrity": "sha1-Wt2BBujJKNssuiMrzZ76hG49oWw=", "dev": true, "requires": { - "debug": "2.6.9", - "object-assign": "4.1.1", - "resolve": "1.4.0" + "debug": "^2.2.0", + "object-assign": "^4.0.1", + "resolve": "^1.1.6" }, "dependencies": { "resolve": { @@ -777,7 +784,7 @@ "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", "dev": true, "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } } } @@ -788,8 +795,8 @@ "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", "dev": true, "requires": { - "debug": "2.6.9", - "pkg-dir": "1.0.0" + "debug": "^2.6.8", + "pkg-dir": "^1.0.0" } }, "eslint-plugin-import": { @@ -798,16 +805,16 @@ "integrity": "sha1-crowb60wXWfEgWNIpGmaQimsi04=", "dev": true, "requires": { - "builtin-modules": "1.1.1", - "contains-path": "0.1.0", - "debug": "2.6.9", + "builtin-modules": "^1.1.1", + "contains-path": "^0.1.0", + "debug": "^2.2.0", "doctrine": "1.5.0", - "eslint-import-resolver-node": "0.2.3", - "eslint-module-utils": "2.1.1", - "has": "1.0.1", - "lodash.cond": "4.5.2", - "minimatch": "3.0.4", - "pkg-up": "1.0.0" + "eslint-import-resolver-node": "^0.2.0", + "eslint-module-utils": "^2.0.0", + "has": "^1.0.1", + "lodash.cond": "^4.3.0", + "minimatch": "^3.0.3", + "pkg-up": "^1.0.0" }, "dependencies": { "balanced-match": { @@ -822,8 +829,8 @@ "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", "dev": true, "requires": { - "balanced-match": "1.0.0", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "doctrine": { @@ -832,8 +839,8 @@ "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" + "esutils": "^2.0.2", + "isarray": "^1.0.0" } }, "minimatch": { @@ -842,7 +849,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "^1.1.7" } } } @@ -853,10 +860,10 @@ "integrity": "sha1-wEOQq428u2iHF0Aj1vOnJ2nmO5c=", "dev": true, "requires": { - "ignore": "3.3.5", - "minimatch": "3.0.4", - "object-assign": "4.1.1", - "resolve": "1.4.0", + "ignore": "^3.0.11", + "minimatch": "^3.0.2", + "object-assign": "^4.0.1", + "resolve": "^1.1.7", "semver": "5.3.0" }, "dependencies": { @@ -872,8 +879,8 @@ "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", "dev": true, "requires": { - "balanced-match": "1.0.0", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "minimatch": { @@ -882,7 +889,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "^1.1.7" } }, "resolve": { @@ -891,7 +898,7 @@ "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", "dev": true, "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } } } @@ -908,11 +915,11 @@ "integrity": "sha1-xUNb6wZ3ThLH2y9qut3L+QDNP3g=", "dev": true, "requires": { - "array.prototype.find": "2.0.4", - "doctrine": "1.5.0", - "has": "1.0.1", - "jsx-ast-utils": "1.4.1", - "object.assign": "4.0.4" + "array.prototype.find": "^2.0.1", + "doctrine": "^1.2.2", + "has": "^1.0.1", + "jsx-ast-utils": "^1.3.4", + "object.assign": "^4.0.4" }, "dependencies": { "doctrine": { @@ -921,8 +928,8 @@ "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" + "esutils": "^2.0.2", + "isarray": "^1.0.0" } } } @@ -939,8 +946,8 @@ "integrity": "sha1-DJiLirRttTEAoZVK5LqZXd0n2H4=", "dev": true, "requires": { - "acorn": "5.1.2", - "acorn-jsx": "3.0.1" + "acorn": "^5.1.1", + "acorn-jsx": "^3.0.0" } }, "esquery": { @@ -949,7 +956,7 @@ "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", "dev": true, "requires": { - "estraverse": "4.2.0" + "estraverse": "^4.0.0" } }, "esrecurse": { @@ -958,8 +965,8 @@ "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", "dev": true, "requires": { - "estraverse": "4.2.0", - "object-assign": "4.1.1" + "estraverse": "^4.1.0", + "object-assign": "^4.0.1" } }, "estraverse": { @@ -980,12 +987,13 @@ "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.30" + "d": "1", + "es5-ext": "~0.10.14" } }, "exit": { - "version": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", "dev": true }, @@ -1007,8 +1015,8 @@ "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "dev": true, "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" } }, "file-entry-cache": { @@ -1017,17 +1025,18 @@ "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { - "flat-cache": "1.2.2", - "object-assign": "4.1.1" + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" } }, "fileset": { - "version": "https://registry.npmjs.org/fileset/-/fileset-0.1.8.tgz", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/fileset/-/fileset-0.1.8.tgz", "integrity": "sha1-UGuRqTluqn4y+0KoQHfHoMc2t0E=", "dev": true, "requires": { - "glob": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz" + "glob": "3.x", + "minimatch": "0.x" } }, "find-root": { @@ -1042,8 +1051,8 @@ "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "flat-cache": { @@ -1052,10 +1061,10 @@ "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", "dev": true, "requires": { - "circular-json": "0.3.3", - "del": "2.2.2", - "graceful-fs": "4.1.11", - "write": "0.2.1" + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" }, "dependencies": { "graceful-fs": { @@ -1077,10 +1086,10 @@ "resolved": "https://registry.npmjs.org/fs-plus/-/fs-plus-3.0.1.tgz", "integrity": "sha1-VMFpxA4ohKZtNSeA0Y3TH5HToQ0=", "requires": { - "async": "1.5.2", - "mkdirp": "0.5.1", - "rimraf": "2.6.2", - "underscore-plus": "1.6.6" + "async": "^1.5.2", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.2", + "underscore-plus": "1.x" }, "dependencies": { "async": { @@ -1098,7 +1107,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -1117,12 +1126,12 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "inflight": { @@ -1130,8 +1139,8 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -1144,7 +1153,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -1165,7 +1174,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "path-is-absolute": { @@ -1178,7 +1187,7 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "underscore": { @@ -1191,7 +1200,7 @@ "resolved": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.6.6.tgz", "integrity": "sha1-ZezeG9xEGjXYnmUP1w3PE65Dmn0=", "requires": { - "underscore": "1.6.0" + "underscore": "~1.6.0" } }, "wrappy": { @@ -1202,7 +1211,8 @@ } }, "fs.realpath": { - "version": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, @@ -1213,12 +1223,13 @@ "dev": true }, "gaze": { - "version": "https://registry.npmjs.org/gaze/-/gaze-0.3.4.tgz", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.3.4.tgz", "integrity": "sha1-X5S92gr+U7xxCWm81vKCVI1gwnk=", "dev": true, "requires": { - "fileset": "https://registry.npmjs.org/fileset/-/fileset-0.1.8.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz" + "fileset": "~0.1.5", + "minimatch": "~0.2.9" } }, "generate-function": { @@ -1233,7 +1244,7 @@ "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", "dev": true, "requires": { - "is-property": "1.0.2" + "is-property": "^1.0.0" } }, "get-stdin": { @@ -1243,17 +1254,19 @@ "dev": true }, "glob": { - "version": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "version": "3.1.21", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", "dev": true, "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz" + "graceful-fs": "~1.2.0", + "inherits": "1", + "minimatch": "~0.2.11" }, "dependencies": { "inherits": { - "version": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", "dev": true } @@ -1271,12 +1284,12 @@ "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { - "array-union": "1.0.2", - "arrify": "1.0.1", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" }, "dependencies": { "balanced-match": { @@ -1291,8 +1304,8 @@ "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", "dev": true, "requires": { - "balanced-match": "1.0.0", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "glob": { @@ -1301,12 +1314,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "3.0.4", - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "minimatch": { @@ -1315,13 +1328,14 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "^1.1.7" } } } }, "graceful-fs": { - "version": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", "dev": true }, @@ -1331,7 +1345,7 @@ "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", "dev": true, "requires": { - "function-bind": "1.1.1" + "function-bind": "^1.0.2" } }, "has-ansi": { @@ -1340,7 +1354,7 @@ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "ignore": { @@ -1356,16 +1370,18 @@ "dev": true }, "inflight": { - "version": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", "integrity": "sha1-2zIEzVqd4ubNiQuFxuL2a89PYgo=", "dev": true, "requires": { - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { - "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, @@ -1375,19 +1391,19 @@ "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", "dev": true, "requires": { - "ansi-escapes": "1.4.0", - "ansi-regex": "2.1.1", - "chalk": "1.1.3", - "cli-cursor": "1.0.2", - "cli-width": "2.2.0", - "figures": "1.7.0", - "lodash": "4.17.4", - "readline2": "1.0.1", - "run-async": "0.1.0", - "rx-lite": "3.1.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "through": "2.3.8" + "ansi-escapes": "^1.1.0", + "ansi-regex": "^2.0.0", + "chalk": "^1.0.0", + "cli-cursor": "^1.0.1", + "cli-width": "^2.0.0", + "figures": "^1.3.5", + "lodash": "^4.3.0", + "readline2": "^1.0.1", + "run-async": "^0.1.0", + "rx-lite": "^3.1.2", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.0", + "through": "^2.3.6" }, "dependencies": { "ansi-styles": { @@ -1402,11 +1418,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "lodash": { @@ -1421,7 +1437,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } } } @@ -1456,7 +1472,7 @@ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-my-json-valid": { @@ -1465,10 +1481,10 @@ "integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==", "dev": true, "requires": { - "generate-function": "2.0.0", - "generate-object-property": "1.2.0", - "jsonpointer": "4.0.1", - "xtend": "4.0.1" + "generate-function": "^2.0.0", + "generate-object-property": "^1.1.0", + "jsonpointer": "^4.0.0", + "xtend": "^4.0.0" } }, "is-path-cwd": { @@ -1483,7 +1499,7 @@ "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", "dev": true, "requires": { - "is-path-inside": "1.0.0" + "is-path-inside": "^1.0.0" } }, "is-path-inside": { @@ -1492,7 +1508,7 @@ "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", "dev": true, "requires": { - "path-is-inside": "1.0.2" + "path-is-inside": "^1.0.1" } }, "is-property": { @@ -1507,7 +1523,7 @@ "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "dev": true, "requires": { - "has": "1.0.1" + "has": "^1.0.1" } }, "is-resolvable": { @@ -1516,7 +1532,7 @@ "integrity": "sha1-jfV8YeouPFAUCNEA+wE8+NbgzGI=", "dev": true, "requires": { - "tryit": "1.0.3" + "tryit": "^1.0.1" } }, "is-symbol": { @@ -1532,40 +1548,44 @@ "dev": true }, "jasmine": { - "version": "https://registry.npmjs.org/jasmine/-/jasmine-2.5.2.tgz", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.5.2.tgz", "integrity": "sha1-YoPO9whcCVzCXWUelU3wBPfj5CE=", "dev": true, "requires": { - "exit": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "glob": "https://registry.npmjs.org/glob/-/glob-7.1.0.tgz", - "jasmine-core": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.5.2.tgz" + "exit": "^0.1.2", + "glob": "^7.0.6", + "jasmine-core": "~2.5.2" }, "dependencies": { "glob": { - "version": "https://registry.npmjs.org/glob/-/glob-7.1.0.tgz", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.0.tgz", "integrity": "sha1-Nq3YVtdG0NmeTMJ5e7oa4sZycv0=", "dev": true, "requires": { - "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "minimatch": { - "version": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", "dev": true, "requires": { - "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + "brace-expansion": "^1.0.0" } } } }, "jasmine-core": { - "version": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.5.2.tgz", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.5.2.tgz", "integrity": "sha1-b2G9eQYeJ/Q+b5NV5Es8bKtv8pc=", "dev": true }, @@ -1575,8 +1595,8 @@ "integrity": "sha1-uDx1fIAOaOHW78GjoaE/85/23NI=", "dev": true, "requires": { - "jasmine-node": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", - "underscore-plus": "1.6.6", + "jasmine-node": "jasmine-node@git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", + "underscore-plus": "1.x", "walkdir": "0.0.7" }, "dependencies": { @@ -1592,7 +1612,7 @@ "integrity": "sha1-ZezeG9xEGjXYnmUP1w3PE65Dmn0=", "dev": true, "requires": { - "underscore": "1.6.0" + "underscore": "~1.6.0" } }, "walkdir": { @@ -1605,34 +1625,37 @@ }, "jasmine-node": { "version": "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": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", - "coffeestack": "https://registry.npmjs.org/coffeestack/-/coffeestack-1.1.2.tgz", - "gaze": "https://registry.npmjs.org/gaze/-/gaze-0.3.4.tgz", - "jasmine-reporters": "https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.2.0.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", - "requirejs": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.2.tgz", - "underscore": "1.5.2", - "walkdir": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.7.tgz" + "coffee-script": ">=1.0.1", + "coffeestack": ">=1 <2", + "gaze": "~0.3.2", + "jasmine-reporters": ">=0.2.0", + "mkdirp": "~0.3.5", + "requirejs": ">=0.27.1", + "underscore": ">= 1.3.1", + "walkdir": ">= 0.0.1" } }, "jasmine-reporters": { - "version": "https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.2.0.tgz", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.2.0.tgz", "integrity": "sha1-6MeRbfPkKDvIgpo/whFA6zIvils=", "dev": true, "requires": { - "jasmine": "https://registry.npmjs.org/jasmine/-/jasmine-2.5.2.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "xmldom": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.22.tgz" + "jasmine": "^2.4.1", + "mkdirp": "^0.5.1", + "xmldom": "^0.1.22" }, "dependencies": { "mkdirp": { - "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { - "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + "minimist": "0.0.8" } } } @@ -1649,7 +1672,7 @@ "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "dev": true, "requires": { - "jsonify": "0.0.0" + "jsonify": "~0.0.0" } }, "jsonify": { @@ -1676,8 +1699,8 @@ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "load-json-file": { @@ -1686,10 +1709,10 @@ "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "strip-bom": "3.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" }, "dependencies": { "graceful-fs": { @@ -1706,8 +1729,8 @@ "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" }, "dependencies": { "path-exists": { @@ -1725,26 +1748,30 @@ "dev": true }, "lru-cache": { - "version": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", "dev": true }, "minimatch": { - "version": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", "dev": true, "requires": { - "lru-cache": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "sigmund": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz" + "lru-cache": "2", + "sigmund": "~1.0.0" } }, "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mkdirp": { - "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=", "dev": true }, @@ -1795,17 +1822,18 @@ "integrity": "sha1-scnMBE7xuf5jYG/BQau7MuFHMMw=", "dev": true, "requires": { - "define-properties": "1.1.2", - "function-bind": "1.1.1", - "object-keys": "1.0.11" + "define-properties": "^1.1.2", + "function-bind": "^1.1.0", + "object-keys": "^1.0.10" } }, "once": { - "version": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "wrappy": "1" } }, "onetime": { @@ -1820,16 +1848,17 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" } }, "os-homedir": { - "version": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, @@ -1845,7 +1874,7 @@ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "p-limit": "1.1.0" + "p-limit": "^1.1.0" } }, "parse-json": { @@ -1854,7 +1883,7 @@ "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { - "error-ex": "1.3.1" + "error-ex": "^1.2.0" } }, "path-exists": { @@ -1863,11 +1892,12 @@ "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { - "pinkie-promise": "2.0.1" + "pinkie-promise": "^2.0.0" } }, "path-is-absolute": { - "version": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, @@ -1901,7 +1931,7 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "pkg-conf": { @@ -1910,8 +1940,8 @@ "integrity": "sha1-BxyHZQQDvM+5xif1h1G/5HwGcnk=", "dev": true, "requires": { - "find-up": "2.1.0", - "load-json-file": "2.0.0" + "find-up": "^2.0.0", + "load-json-file": "^2.0.0" }, "dependencies": { "find-up": { @@ -1920,7 +1950,7 @@ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } } } @@ -1931,9 +1961,9 @@ "integrity": "sha1-VX7yLXPaPIg3EHdmxS6tq94pj+Q=", "dev": true, "requires": { - "debug-log": "1.0.1", - "find-root": "1.1.0", - "xtend": "4.0.1" + "debug-log": "^1.0.0", + "find-root": "^1.0.0", + "xtend": "^4.0.1" } }, "pkg-dir": { @@ -1942,7 +1972,7 @@ "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", "dev": true, "requires": { - "find-up": "1.1.2" + "find-up": "^1.0.0" } }, "pkg-up": { @@ -1951,7 +1981,7 @@ "integrity": "sha1-Pgj7RhUlxEIWJKM7n35tCvWwWiY=", "dev": true, "requires": { - "find-up": "1.1.2" + "find-up": "^1.0.0" } }, "pluralize": { @@ -1984,13 +2014,13 @@ "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.0.3", + "util-deprecate": "~1.0.1" } }, "readline2": { @@ -1999,8 +2029,8 @@ "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", "mute-stream": "0.0.5" } }, @@ -2010,7 +2040,7 @@ "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { - "resolve": "1.4.0" + "resolve": "^1.1.6" }, "dependencies": { "resolve": { @@ -2019,7 +2049,7 @@ "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", "dev": true, "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } } } @@ -2030,12 +2060,13 @@ "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { - "caller-path": "0.1.0", - "resolve-from": "1.0.1" + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" } }, "requirejs": { - "version": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.2.tgz", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.2.tgz", "integrity": "sha1-DqqHDUx9s7Fd0TIua2WwOI/EssY=", "dev": true }, @@ -2051,12 +2082,13 @@ "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", "dev": true, "requires": { - "exit-hook": "1.1.1", - "onetime": "1.1.0" + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" } }, "rimraf": { - "version": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=", "dev": true }, @@ -2066,7 +2098,7 @@ "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", "dev": true, "requires": { - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + "once": "^1.3.0" } }, "run-parallel": { @@ -2099,9 +2131,9 @@ "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", "dev": true, "requires": { - "glob": "7.1.2", - "interpret": "1.0.4", - "rechoir": "0.6.2" + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" }, "dependencies": { "balanced-match": { @@ -2116,8 +2148,8 @@ "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", "dev": true, "requires": { - "balanced-match": "1.0.0", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "glob": { @@ -2126,12 +2158,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "3.0.4", - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "minimatch": { @@ -2140,13 +2172,14 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "^1.1.7" } } } }, "sigmund": { - "version": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", "dev": true }, @@ -2157,11 +2190,12 @@ "dev": true }, "source-map": { - "version": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", "dev": true, "requires": { - "amdefine": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz" + "amdefine": ">=0.0.4" } }, "sprintf-js": { @@ -2176,15 +2210,15 @@ "integrity": "sha1-eGm8v0Ir3uqraJof+x/qlnfdUOo=", "dev": true, "requires": { - "eslint": "3.19.0", + "eslint": "~3.19.0", "eslint-config-standard": "10.2.1", "eslint-config-standard-jsx": "4.0.2", - "eslint-plugin-import": "2.2.0", - "eslint-plugin-node": "4.2.3", - "eslint-plugin-promise": "3.5.0", - "eslint-plugin-react": "6.10.3", - "eslint-plugin-standard": "3.0.1", - "standard-engine": "7.0.0" + "eslint-plugin-import": "~2.2.0", + "eslint-plugin-node": "~4.2.2", + "eslint-plugin-promise": "~3.5.0", + "eslint-plugin-react": "~6.10.0", + "eslint-plugin-standard": "~3.0.1", + "standard-engine": "~7.0.0" } }, "standard-engine": { @@ -2193,10 +2227,10 @@ "integrity": "sha1-67d7nI/CyBZf+jU72Rug3/Qa9pA=", "dev": true, "requires": { - "deglob": "2.1.0", - "get-stdin": "5.0.1", - "minimist": "1.2.0", - "pkg-conf": "2.0.0" + "deglob": "^2.1.0", + "get-stdin": "^5.0.1", + "minimist": "^1.1.0", + "pkg-conf": "^2.0.0" }, "dependencies": { "minimist": { @@ -2213,9 +2247,9 @@ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" }, "dependencies": { "strip-ansi": { @@ -2224,7 +2258,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } } } @@ -2235,7 +2269,7 @@ "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", "dev": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "~5.1.0" } }, "strip-bom": { @@ -2262,12 +2296,12 @@ "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", "dev": true, "requires": { - "ajv": "4.11.8", - "ajv-keywords": "1.5.1", - "chalk": "1.1.3", - "lodash": "4.17.4", + "ajv": "^4.7.0", + "ajv-keywords": "^1.0.0", + "chalk": "^1.1.1", + "lodash": "^4.0.0", "slice-ansi": "0.0.4", - "string-width": "2.1.1" + "string-width": "^2.0.0" }, "dependencies": { "ansi-styles": { @@ -2282,11 +2316,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "is-fullwidth-code-point": { @@ -2307,8 +2341,8 @@ "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" }, "dependencies": { "ansi-regex": { @@ -2323,7 +2357,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -2334,7 +2368,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } } } @@ -2345,7 +2379,7 @@ "integrity": "sha1-d6sZx5qntZPL5PrCRBdoytmHuN8=", "dev": true, "requires": { - "rimraf": "2.1.4" + "rimraf": "~2.1.4" }, "dependencies": { "graceful-fs": { @@ -2361,7 +2395,7 @@ "integrity": "sha1-Wm62Lu2gaPUe3lDymz5c0i89m7I=", "dev": true, "requires": { - "graceful-fs": "1.2.3" + "graceful-fs": "~1" } } } @@ -2390,7 +2424,7 @@ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, "typedarray": { @@ -2417,7 +2451,7 @@ "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", "dev": true, "requires": { - "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" + "os-homedir": "^1.0.0" } }, "util-deprecate": { @@ -2427,7 +2461,8 @@ "dev": true }, "walkdir": { - "version": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.7.tgz", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.7.tgz", "integrity": "sha1-BNoCcKh6d4VAFzzb8KLbSZqNnik=", "dev": true }, @@ -2438,7 +2473,8 @@ "dev": true }, "wrappy": { - "version": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, @@ -2454,7 +2490,7 @@ "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", "dev": true, "requires": { - "mkdirp": "0.5.1" + "mkdirp": "^0.5.1" }, "dependencies": { "mkdirp": { @@ -2463,13 +2499,14 @@ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { - "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + "minimist": "0.0.8" } } } }, "xmldom": { - "version": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.22.tgz", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.22.tgz", "integrity": "sha1-EN5OXpZJgfA8jMcvrcCNFLbDqiY=", "dev": true }, From c7cdcbc3d873c0e7aa33d85656e7d225d31d065b Mon Sep 17 00:00:00 2001 From: Winston Liu <50Wliu@users.noreply.github.com> Date: Tue, 21 May 2019 13:52:55 -0400 Subject: [PATCH 159/194] 5.5.1-electron-4.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0fdc34c3..73700917 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.5.0", + "version": "5.5.1-electron-4.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 32cacfd1..904fd12a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.5.0", + "version": "5.5.1-electron-4.0", "license": "MIT", "author": { "name": "Kevin Sawicki", From 7cfff3d32e2959f8ac2204533576c3eef5b77fac Mon Sep 17 00:00:00 2001 From: Winston Liu <50Wliu@users.noreply.github.com> Date: Tue, 21 May 2019 14:11:59 -0400 Subject: [PATCH 160/194] Use Node 10 on Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c4df7788..9c5365c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ notifications: on_success: never on_failure: change -node_js: node +node_js: "10" git: depth: 10 From 38512f899e9bf9633554a52595da3d5af6aee81b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 3 Jun 2019 13:58:42 -0600 Subject: [PATCH 161/194] Prefix relatived paths with ./ to avoid gitignore quirk When passing the path to a file that is ignored via a pattern like `**.log`, libgit2 only recognizes the path as ignored if it starts with `./`. So we change the `relativize` method to include a leading `./` so that these kind of patterns work correctly on relativized paths. Co-Authored-By: Antonio Scandurra --- spec/fixtures/ignored-workspace/.gitignore | 1 + spec/fixtures/ignored-workspace/ignored.test | 0 spec/git-spec.js | 19 ++++++++++--------- src/git.js | 8 ++++---- 4 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 spec/fixtures/ignored-workspace/ignored.test diff --git a/spec/fixtures/ignored-workspace/.gitignore b/spec/fixtures/ignored-workspace/.gitignore index e69de29b..21f4bd91 100644 --- a/spec/fixtures/ignored-workspace/.gitignore +++ b/spec/fixtures/ignored-workspace/.gitignore @@ -0,0 +1 @@ +**.test diff --git a/spec/fixtures/ignored-workspace/ignored.test b/spec/fixtures/ignored-workspace/ignored.test new file mode 100644 index 00000000..e69de29b diff --git a/spec/git-spec.js b/spec/git-spec.js index 2ebff2dd..4fa599f0 100644 --- a/spec/git-spec.js +++ b/spec/git-spec.js @@ -132,6 +132,7 @@ describe('git', () => { repo = git.open(ignoreRepoDir) expect(repo.isIgnored('a.txt')).toBe(true) expect(repo.isIgnored('subdir/subdir')).toBe(true) + expect(repo.isIgnored(repo.relativize(path.join(ignoreRepoDir, 'ignored.test')))).toBe(true) }) }) @@ -854,8 +855,8 @@ describe('git', () => { repo = git.open(__dirname) const workingDirectory = repo.getWorkingDirectory() - expect(repo.relativize(path.join(workingDirectory, 'a.txt'))).toBe('a.txt') - expect(repo.relativize(path.join(workingDirectory, 'a/b/c.txt'))).toBe('a/b/c.txt') + expect(repo.relativize(path.join(workingDirectory, 'a.txt'))).toBe('./a.txt') + expect(repo.relativize(path.join(workingDirectory, 'a/b/c.txt'))).toBe('./a/b/c.txt') expect(repo.relativize('a.txt')).toBe('a.txt') expect(repo.relativize('/not/in/working/dir')).toBe('/not/in/working/dir') expect(repo.relativize(null)).toBe(null) @@ -876,9 +877,9 @@ describe('git', () => { fs.symlinkSync(repoDirectory, linkDirectory) repo = git.open(linkDirectory) - expect(repo.relativize(path.join(repoDirectory, 'test1'))).toBe('test1') - expect(repo.relativize(path.join(linkDirectory, 'test2'))).toBe('test2') - expect(repo.relativize(path.join(linkDirectory, 'test2/test3'))).toBe('test2/test3') + expect(repo.relativize(path.join(repoDirectory, 'test1'))).toBe('./test1') + expect(repo.relativize(path.join(linkDirectory, 'test2'))).toBe('./test2') + expect(repo.relativize(path.join(linkDirectory, 'test2/test3'))).toBe('./test2/test3') expect(repo.relativize('test2/test3')).toBe('test2/test3') }) }) @@ -890,8 +891,8 @@ describe('git', () => { repo.caseInsensitiveFs = true const workingDirectory = repo.getWorkingDirectory() - expect(repo.relativize(path.join(workingDirectory.toUpperCase(), 'a.txt'))).toBe('a.txt') - expect(repo.relativize(path.join(workingDirectory.toUpperCase(), 'a/b/c.txt'))).toBe('a/b/c.txt') + expect(repo.relativize(path.join(workingDirectory.toUpperCase(), 'a.txt'))).toBe('./a.txt') + expect(repo.relativize(path.join(workingDirectory.toUpperCase(), 'a/b/c.txt'))).toBe('./a/b/c.txt') const linkDirectory = path.join(fs.realpathSync(temp.mkdirSync('lower-case-symlink')), 'link') wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) @@ -899,8 +900,8 @@ describe('git', () => { repo = git.open(linkDirectory) repo.caseInsensitiveFs = true - expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2'))).toBe('test2') - expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2/test3'))).toBe('test2/test3') + expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2'))).toBe('./test2') + expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2/test3'))).toBe('./test2/test3') }) }) diff --git a/src/git.js b/src/git.js index 217e6038..14efbe1b 100644 --- a/src/git.js +++ b/src/git.js @@ -169,7 +169,7 @@ Repository.prototype.relativize = function (path) { if (workingDirectory) { workingDirectory = workingDirectory.toLowerCase() if (lowerCasePath.startsWith(`${workingDirectory}/`)) { - return path.substring(workingDirectory.length + 1) + return './' + path.substring(workingDirectory.length + 1) } else if (lowerCasePath === workingDirectory) { return '' } @@ -178,7 +178,7 @@ Repository.prototype.relativize = function (path) { if (this.openedWorkingDirectory) { workingDirectory = this.openedWorkingDirectory.toLowerCase() if (lowerCasePath.startsWith(`${workingDirectory}/`)) { - return path.substring(workingDirectory.length + 1) + return './' + path.substring(workingDirectory.length + 1) } else if (lowerCasePath === workingDirectory) { return '' } @@ -187,7 +187,7 @@ Repository.prototype.relativize = function (path) { workingDirectory = this.getWorkingDirectory() if (workingDirectory) { if (path.startsWith(`${workingDirectory}/`)) { - return path.substring(workingDirectory.length + 1) + return './' + path.substring(workingDirectory.length + 1) } else if (path === workingDirectory) { return '' } @@ -195,7 +195,7 @@ Repository.prototype.relativize = function (path) { if (this.openedWorkingDirectory) { if (path.startsWith(`${this.openedWorkingDirectory}/`)) { - return path.substring(this.openedWorkingDirectory.length + 1) + return './' + path.substring(this.openedWorkingDirectory.length + 1) } else if (path === this.openedWorkingDirectory) { return '' } From d166d57501fff3d426c06a5a16ca02751edf2da5 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 3 Jun 2019 14:13:52 -0600 Subject: [PATCH 162/194] Use Node 10 on travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c4df7788..a3a131a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ notifications: on_success: never on_failure: change -node_js: node +node_js: 10 git: depth: 10 From 9fccaa17b8fbaa729563f3dcd37fc40703aff4a1 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 3 Jun 2019 14:33:36 -0600 Subject: [PATCH 163/194] 6.0.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 504acb0d..5082f84a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.5.0", + "version": "6.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 32cacfd1..385a1364 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.5.0", + "version": "6.0.0", "license": "MIT", "author": { "name": "Kevin Sawicki", From 3208c12b63fd17d3e5847c98e5e7044592938a03 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 3 Jun 2019 16:18:42 -0600 Subject: [PATCH 164/194] Revert "6.0.0" This reverts commit 9fccaa17b8fbaa729563f3dcd37fc40703aff4a1. --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5082f84a..504acb0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "6.0.0", + "version": "5.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 385a1364..32cacfd1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "6.0.0", + "version": "5.5.0", "license": "MIT", "author": { "name": "Kevin Sawicki", From 2fed01a8064d87f0399d3e595db987cf03afd5dd Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 3 Jun 2019 16:19:00 -0600 Subject: [PATCH 165/194] Revert "Merge pull request #95 from atom/as-ns/fix-relativize" This reverts commit e46f3ee8f2515cac6ba20cf8c48271b692750af8, reversing changes made to 1c9311b383746cb4f0c3bca9c859c8c71c6e0b0e. --- .travis.yml | 2 +- spec/fixtures/ignored-workspace/.gitignore | 1 - spec/fixtures/ignored-workspace/ignored.test | 0 spec/git-spec.js | 19 +++++++++---------- src/git.js | 8 ++++---- 5 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 spec/fixtures/ignored-workspace/ignored.test diff --git a/.travis.yml b/.travis.yml index a3a131a1..c4df7788 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ notifications: on_success: never on_failure: change -node_js: 10 +node_js: node git: depth: 10 diff --git a/spec/fixtures/ignored-workspace/.gitignore b/spec/fixtures/ignored-workspace/.gitignore index 21f4bd91..e69de29b 100644 --- a/spec/fixtures/ignored-workspace/.gitignore +++ b/spec/fixtures/ignored-workspace/.gitignore @@ -1 +0,0 @@ -**.test diff --git a/spec/fixtures/ignored-workspace/ignored.test b/spec/fixtures/ignored-workspace/ignored.test deleted file mode 100644 index e69de29b..00000000 diff --git a/spec/git-spec.js b/spec/git-spec.js index 4fa599f0..2ebff2dd 100644 --- a/spec/git-spec.js +++ b/spec/git-spec.js @@ -132,7 +132,6 @@ describe('git', () => { repo = git.open(ignoreRepoDir) expect(repo.isIgnored('a.txt')).toBe(true) expect(repo.isIgnored('subdir/subdir')).toBe(true) - expect(repo.isIgnored(repo.relativize(path.join(ignoreRepoDir, 'ignored.test')))).toBe(true) }) }) @@ -855,8 +854,8 @@ describe('git', () => { repo = git.open(__dirname) const workingDirectory = repo.getWorkingDirectory() - expect(repo.relativize(path.join(workingDirectory, 'a.txt'))).toBe('./a.txt') - expect(repo.relativize(path.join(workingDirectory, 'a/b/c.txt'))).toBe('./a/b/c.txt') + expect(repo.relativize(path.join(workingDirectory, 'a.txt'))).toBe('a.txt') + expect(repo.relativize(path.join(workingDirectory, 'a/b/c.txt'))).toBe('a/b/c.txt') expect(repo.relativize('a.txt')).toBe('a.txt') expect(repo.relativize('/not/in/working/dir')).toBe('/not/in/working/dir') expect(repo.relativize(null)).toBe(null) @@ -877,9 +876,9 @@ describe('git', () => { fs.symlinkSync(repoDirectory, linkDirectory) repo = git.open(linkDirectory) - expect(repo.relativize(path.join(repoDirectory, 'test1'))).toBe('./test1') - expect(repo.relativize(path.join(linkDirectory, 'test2'))).toBe('./test2') - expect(repo.relativize(path.join(linkDirectory, 'test2/test3'))).toBe('./test2/test3') + expect(repo.relativize(path.join(repoDirectory, 'test1'))).toBe('test1') + expect(repo.relativize(path.join(linkDirectory, 'test2'))).toBe('test2') + expect(repo.relativize(path.join(linkDirectory, 'test2/test3'))).toBe('test2/test3') expect(repo.relativize('test2/test3')).toBe('test2/test3') }) }) @@ -891,8 +890,8 @@ describe('git', () => { repo.caseInsensitiveFs = true const workingDirectory = repo.getWorkingDirectory() - expect(repo.relativize(path.join(workingDirectory.toUpperCase(), 'a.txt'))).toBe('./a.txt') - expect(repo.relativize(path.join(workingDirectory.toUpperCase(), 'a/b/c.txt'))).toBe('./a/b/c.txt') + expect(repo.relativize(path.join(workingDirectory.toUpperCase(), 'a.txt'))).toBe('a.txt') + expect(repo.relativize(path.join(workingDirectory.toUpperCase(), 'a/b/c.txt'))).toBe('a/b/c.txt') const linkDirectory = path.join(fs.realpathSync(temp.mkdirSync('lower-case-symlink')), 'link') wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git')) @@ -900,8 +899,8 @@ describe('git', () => { repo = git.open(linkDirectory) repo.caseInsensitiveFs = true - expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2'))).toBe('./test2') - expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2/test3'))).toBe('./test2/test3') + expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2'))).toBe('test2') + expect(repo.relativize(path.join(linkDirectory.toUpperCase(), 'test2/test3'))).toBe('test2/test3') }) }) diff --git a/src/git.js b/src/git.js index 14efbe1b..217e6038 100644 --- a/src/git.js +++ b/src/git.js @@ -169,7 +169,7 @@ Repository.prototype.relativize = function (path) { if (workingDirectory) { workingDirectory = workingDirectory.toLowerCase() if (lowerCasePath.startsWith(`${workingDirectory}/`)) { - return './' + path.substring(workingDirectory.length + 1) + return path.substring(workingDirectory.length + 1) } else if (lowerCasePath === workingDirectory) { return '' } @@ -178,7 +178,7 @@ Repository.prototype.relativize = function (path) { if (this.openedWorkingDirectory) { workingDirectory = this.openedWorkingDirectory.toLowerCase() if (lowerCasePath.startsWith(`${workingDirectory}/`)) { - return './' + path.substring(workingDirectory.length + 1) + return path.substring(workingDirectory.length + 1) } else if (lowerCasePath === workingDirectory) { return '' } @@ -187,7 +187,7 @@ Repository.prototype.relativize = function (path) { workingDirectory = this.getWorkingDirectory() if (workingDirectory) { if (path.startsWith(`${workingDirectory}/`)) { - return './' + path.substring(workingDirectory.length + 1) + return path.substring(workingDirectory.length + 1) } else if (path === workingDirectory) { return '' } @@ -195,7 +195,7 @@ Repository.prototype.relativize = function (path) { if (this.openedWorkingDirectory) { if (path.startsWith(`${this.openedWorkingDirectory}/`)) { - return './' + path.substring(this.openedWorkingDirectory.length + 1) + return path.substring(this.openedWorkingDirectory.length + 1) } else if (path === this.openedWorkingDirectory) { return '' } From 3a3f8a562157c12f3f5417d55bf463cc2edc44f8 Mon Sep 17 00:00:00 2001 From: Rafael Oleza Date: Mon, 17 Jun 2019 16:33:32 +0200 Subject: [PATCH 166/194] Update package-lock file --- package-lock.json | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index 73700917..db7ff056 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1595,37 +1595,14 @@ "integrity": "sha1-uDx1fIAOaOHW78GjoaE/85/23NI=", "dev": true, "requires": { - "jasmine-node": "jasmine-node@git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", + "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": "jasmine-node@git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", + "from": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", "dev": true, "requires": { "coffee-script": ">=1.0.1", @@ -2439,6 +2416,23 @@ "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", From 76513456c02e0a7d53b9dfdde43611bd67416dc5 Mon Sep 17 00:00:00 2001 From: Rafael Oleza Date: Mon, 17 Jun 2019 16:33:36 +0200 Subject: [PATCH 167/194] 5.6.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index db7ff056..c55a35ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.5.1-electron-4.0", + "version": "5.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 904fd12a..d02ea3eb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.5.1-electron-4.0", + "version": "5.6.0", "license": "MIT", "author": { "name": "Kevin Sawicki", From 7aa4ed48a1dab2b43fdf85a54c13f424f139c6a8 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 Jun 2019 16:28:04 -0600 Subject: [PATCH 168/194] Update deps/libgit2 submodule to include fix for ** in gitignore See https://github.com/libgit2/libgit2/pull/5110 --- binding.gyp | 8 ++--- deps/libgit2 | 2 +- package-lock.json | 44 +++++++++++++++----------- spec/fixtures/ignored.git/info/exclude | 1 + spec/git-spec.js | 2 ++ 5 files changed, 33 insertions(+), 24 deletions(-) diff --git a/binding.gyp b/binding.gyp index ded6dc7f..b2e71245 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', 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) }) }) From 12d7ac69119d39406541aafdfbc08bc61a40c104 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 19 Jun 2019 11:29:17 -0600 Subject: [PATCH 169/194] Fix Windows build problems with new libgit2 version Co-Authored-By: Antonio Scandurra --- binding.gyp | 62 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/binding.gyp b/binding.gyp index b2e71245..71fafacd 100644 --- a/binding.gyp +++ b/binding.gyp @@ -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', + ], + }, + }, + ] + }] + ] } From 06820e2ec1174840f87c5d82ded9a0d1af0ed0e3 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 20 Jun 2019 09:40:36 -0600 Subject: [PATCH 170/194] 5.6.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 99dab848..c4ff155e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.6.0", + "version": "5.6.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d02ea3eb..93ea078c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.6.0", + "version": "5.6.1", "license": "MIT", "author": { "name": "Kevin Sawicki", From 18a8e99fd56deb07ea8515378c9d0c7c730d919c Mon Sep 17 00:00:00 2001 From: Joonmo Yang Date: Tue, 26 Nov 2019 01:35:33 +0900 Subject: [PATCH 171/194] Upgrade nan to ^2.14.0 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index c4ff155e..8df10a4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1788,9 +1788,9 @@ "dev": true }, "nan": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", - "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=" + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" }, "natural-compare": { "version": "1.4.0", diff --git a/package.json b/package.json index 93ea078c..06cd5e6b 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "wrench": "~1.4.4" }, "dependencies": { - "nan": "^2.0.0", + "nan": "^2.14.0", "fs-plus": "^3.0.0" }, "scripts": { From 9578ef82ec721f0273c55807fd3bb0c3cec0d2fa Mon Sep 17 00:00:00 2001 From: Joonmo Yang Date: Tue, 26 Nov 2019 00:09:30 +0900 Subject: [PATCH 172/194] Use Nan::Utf8String instead of String::Utf8Value --- src/repository.cc | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index 103e2ba0..da430075 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -87,7 +87,7 @@ git_repository* Repository::GetAsyncRepository(Nan::NAN_METHOD_ARGS_TYPE args) { int Repository::GetBlob(Nan::NAN_METHOD_ARGS_TYPE args, git_repository* repo, git_blob*& blob) { - std::string path(*String::Utf8Value(args[0])); + std::string path(*Nan::Utf8String(args[0])); int useIndex = false; if (args.Length() >= 3) { @@ -266,7 +266,7 @@ NAN_METHOD(Repository::IsIgnored) { return info.GetReturnValue().Set(Nan::New(false)); git_repository* repository = GetRepository(info); - std::string path(*String::Utf8Value(info[0])); + std::string path(*Nan::Utf8String(info[0])); int ignored; if (git_ignore_path_is_ignored(&ignored, repository, @@ -284,7 +284,7 @@ NAN_METHOD(Repository::IsSubmodule) { git_index* index; git_repository* repository = GetRepository(info); if (git_repository_index(&index, repository) == GIT_OK) { - std::string path(*String::Utf8Value(info[0])); + std::string path(*Nan::Utf8String(info[0])); const git_index_entry* entry = git_index_get_bypath(index, path.c_str(), 0); Local isSubmodule = Nan::New( entry != NULL && (entry->mode & S_IFMT) == GIT_FILEMODE_COMMIT); @@ -305,7 +305,7 @@ NAN_METHOD(Repository::GetConfigValue) { if (git_repository_config_snapshot(&config, repository) != GIT_OK) return info.GetReturnValue().Set(Nan::Null()); - std::string configKey(*String::Utf8Value(info[0])); + std::string configKey(*Nan::Utf8String(info[0])); const char* configValue; if (git_config_get_string( &configValue, config, configKey.c_str()) == GIT_OK) { @@ -328,8 +328,8 @@ NAN_METHOD(Repository::SetConfigValue) { if (git_repository_config(&config, repository) != GIT_OK) return info.GetReturnValue().Set(Nan::New(false)); - std::string configKey(*String::Utf8Value(info[0])); - std::string configValue(*String::Utf8Value(info[1])); + std::string configKey(*Nan::Utf8String(info[0])); + std::string configValue(*Nan::Utf8String(info[1])); int errorCode = git_config_set_string( config, configKey.c_str(), configValue.c_str()); @@ -434,7 +434,7 @@ NAN_METHOD(Repository::GetStatus) { NAN_METHOD(Repository::GetStatusForPath) { git_repository* repository = GetRepository(info); - String::Utf8Value path(info[0]); + Nan::Utf8String path(info[0]); unsigned int status = 0; if (git_status_file(&status, repository, *path) == GIT_OK) return info.GetReturnValue().Set(Nan::New(status)); @@ -447,7 +447,7 @@ NAN_METHOD(Repository::CheckoutHead) { if (info.Length() < 1) return info.GetReturnValue().Set(Nan::New(false)); - String::Utf8Value utf8Path(info[0]); + Nan::Utf8String utf8Path(info[0]); char* path = *utf8Path; git_checkout_options options = GIT_CHECKOUT_OPTIONS_INIT; @@ -467,7 +467,7 @@ NAN_METHOD(Repository::GetReferenceTarget) { if (info.Length() < 1) return info.GetReturnValue().Set(Nan::Null()); - std::string refName(*String::Utf8Value(info[0])); + std::string refName(*Nan::Utf8String(info[0])); git_oid sha; if (git_reference_name_to_id( &sha, GetRepository(info), refName.c_str()) == GIT_OK) { @@ -512,7 +512,7 @@ NAN_METHOD(Repository::GetDiffStats) { if (treeStatus != GIT_OK) return info.GetReturnValue().Set(result); - String::Utf8Value utf8Path(info[0]); + Nan::Utf8String utf8Path(info[0]); char* path = *utf8Path; git_diff_options options = CreateDefaultGitDiffOptions(); @@ -573,7 +573,7 @@ NAN_METHOD(Repository::GetHeadBlob) { if (info.Length() < 1) return info.GetReturnValue().Set(Nan::Null()); - std::string path(*String::Utf8Value(info[0])); + std::string path(*Nan::Utf8String(info[0])); git_repository* repo = GetRepository(info); git_reference* head; @@ -619,7 +619,7 @@ NAN_METHOD(Repository::GetIndexBlob) { if (info.Length() < 1) return info.GetReturnValue().Set(Nan::Null()); - std::string path(*String::Utf8Value(info[0])); + std::string path(*Nan::Utf8String(info[0])); git_repository* repo = GetRepository(info); git_index* index; @@ -713,8 +713,8 @@ class CompareCommitsWorker { CompareCommitsWorker(git_repository *repository, Local js_left_id, Local js_right_id) : repository(repository) { - left_id = *String::Utf8Value(js_left_id); - right_id = *String::Utf8Value(js_right_id); + left_id = *Nan::Utf8String(js_left_id); + right_id = *Nan::Utf8String(js_right_id); } }; @@ -772,7 +772,7 @@ NAN_METHOD(Repository::GetLineDiffs) { if (info.Length() < 2) return info.GetReturnValue().Set(Nan::Null()); - std::string text(*String::Utf8Value(info[1])); + std::string text(*Nan::Utf8String(info[1])); git_repository* repo = GetRepository(info); @@ -845,7 +845,7 @@ NAN_METHOD(Repository::GetLineDiffDetails) { if (info.Length() < 2) return info.GetReturnValue().Set(Nan::Null()); - std::string text(*String::Utf8Value(info[1])); + std::string text(*Nan::Utf8String(info[1])); git_repository* repo = GetRepository(info); @@ -976,7 +976,7 @@ NAN_METHOD(Repository::CheckoutReference) { else shouldCreateNewRef = false; - std::string strRefName(*String::Utf8Value(info[0])); + std::string strRefName(*Nan::Utf8String(info[0])); const char* refName = strRefName.c_str(); git_repository* repo = GetRepository(info); @@ -1021,7 +1021,7 @@ NAN_METHOD(Repository::Add) { Nan::HandleScope scope; git_repository* repository = GetRepository(info); - std::string path(*String::Utf8Value(info[0])); + std::string path(*Nan::Utf8String(info[0])); git_index* index; if (git_repository_index(&index, repository) != GIT_OK) { @@ -1061,7 +1061,7 @@ Repository::Repository(Local path, Local search) { flags |= GIT_REPOSITORY_OPEN_NO_SEARCH; } - String::Utf8Value repository_path(path); + Nan::Utf8String repository_path(path); int result = git_repository_open_ext(&repository, *repository_path, flags, NULL); if (result != GIT_OK) { repository = NULL; From de8262c5a8ea4cbb8620a6bdf3b5b27e03521345 Mon Sep 17 00:00:00 2001 From: Joonmo Yang Date: Tue, 26 Nov 2019 00:27:12 +0900 Subject: [PATCH 173/194] Use Nan::To instead of BooleanValue --- src/repository.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index da430075..19b8e543 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -92,8 +92,7 @@ int Repository::GetBlob(Nan::NAN_METHOD_ARGS_TYPE args, int useIndex = false; if (args.Length() >= 3) { Local optionsArg(Local::Cast(args[2])); - if (optionsArg->Get( - Nan::New("useIndex").ToLocalChecked())->BooleanValue()) + if (Nan::To(optionsArg->Get(Nan::New("useIndex").ToLocalChecked())).FromJust()) useIndex = true; } @@ -793,7 +792,7 @@ NAN_METHOD(Repository::GetLineDiffs) { ignoreEolWhitespace = optionsArg->Get( Nan::New("ignoreEolWhitespace").ToLocalChecked()); - if (ignoreEolWhitespace->BooleanValue()) + if (Nan::To(ignoreEolWhitespace).FromJust()) options.flags = GIT_DIFF_IGNORE_WHITESPACE_EOL; } @@ -866,7 +865,7 @@ NAN_METHOD(Repository::GetLineDiffDetails) { ignoreEolWhitespace = optionsArg->Get( Nan::New("ignoreEolWhitespace").ToLocalChecked()); - if (ignoreEolWhitespace->BooleanValue()) + if (Nan::To(ignoreEolWhitespace).FromJust()) options.flags = GIT_DIFF_IGNORE_WHITESPACE_EOL; } @@ -971,7 +970,7 @@ NAN_METHOD(Repository::CheckoutReference) { return info.GetReturnValue().Set(Nan::New(false)); bool shouldCreateNewRef; - if (info.Length() > 1 && info[1]->BooleanValue()) + if (info.Length() > 1 && Nan::To(info[1]).FromJust()) shouldCreateNewRef = true; else shouldCreateNewRef = false; @@ -1057,7 +1056,7 @@ Repository::Repository(Local path, Local search) { Nan::HandleScope scope; int flags = 0; - if (!search->BooleanValue()) { + if (!Nan::To(search).FromJust()) { flags |= GIT_REPOSITORY_OPEN_NO_SEARCH; } From a089080ef175325d1b71f58f6d1b3fa4324ee914 Mon Sep 17 00:00:00 2001 From: Joonmo Yang Date: Tue, 26 Nov 2019 01:18:34 +0900 Subject: [PATCH 174/194] Use Nan::Get/Set --- src/repository.cc | 134 +++++++++++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 56 deletions(-) diff --git a/src/repository.cc b/src/repository.cc index 19b8e543..90eef52b 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -63,8 +63,9 @@ void Repository::Init(Local target) { Nan::SetMethod(proto, "checkoutRef", Repository::CheckoutReference); Nan::SetMethod(proto, "add", Repository::Add); - target->Set(Nan::New("Repository").ToLocalChecked(), - newTemplate->GetFunction()); + Nan::Set(target, + Nan::New("Repository").ToLocalChecked(), + Nan::GetFunction(newTemplate).ToLocalChecked()); } NODE_MODULE(git, Repository::Init) @@ -92,7 +93,7 @@ int Repository::GetBlob(Nan::NAN_METHOD_ARGS_TYPE args, int useIndex = false; if (args.Length() >= 3) { Local optionsArg(Local::Cast(args[2])); - if (Nan::To(optionsArg->Get(Nan::New("useIndex").ToLocalChecked())).FromJust()) + if (Nan::To(Nan::Get(optionsArg, Nan::New("useIndex").ToLocalChecked()).ToLocalChecked()).FromJust()) useIndex = true; } @@ -185,7 +186,7 @@ NAN_METHOD(Repository::GetSubmodulePaths) { git_submodule_foreach(repository, SubmoduleCallback, &paths); Local v8Paths = Nan::New(paths.size()); for (size_t i = 0; i < paths.size(); i++) - v8Paths->Set(i, Nan::New(paths[i].data()).ToLocalChecked()); + Nan::Set(v8Paths, i, Nan::New(paths[i].data()).ToLocalChecked()); info.GetReturnValue().Set(v8Paths); } @@ -367,7 +368,8 @@ class StatusWorker { if (code == GIT_OK) { Local result = Nan::New(); for (auto iter = statuses.begin(), end = statuses.end(); iter != end; ++iter) { - result->Set( + Nan::Set( + result, Nan::New(iter->first.c_str()).ToLocalChecked(), Nan::New(iter->second) ); @@ -384,9 +386,9 @@ class StatusWorker { path_count = js_paths->Length(); paths = reinterpret_cast(malloc(path_count * sizeof(char *))); for (unsigned i = 0; i < path_count; i++) { - auto js_path = Local::Cast(js_paths->Get(i)); - paths[i] = reinterpret_cast(malloc(js_path->Utf8Length() + 1)); - js_path->WriteUtf8(paths[i]); + Nan::Utf8String js_path(Nan::Get(js_paths, i).ToLocalChecked()); + paths[i] = reinterpret_cast(malloc(js_path.length() + 1)); + strcpy(paths[i], *js_path); } } else { paths = NULL; @@ -485,10 +487,12 @@ NAN_METHOD(Repository::GetDiffStats) { int added = 0; int deleted = 0; Local result = Nan::New(); - result->Set(Nan::New("added").ToLocalChecked(), - Nan::New(added)); - result->Set(Nan::New("deleted").ToLocalChecked(), - Nan::New(deleted)); + Nan::Set(result, + Nan::New("added").ToLocalChecked(), + Nan::New(added)); + Nan::Set(result, + Nan::New("deleted").ToLocalChecked(), + Nan::New(deleted)); if (info.Length() < 1) return info.GetReturnValue().Set(result); @@ -559,10 +563,12 @@ NAN_METHOD(Repository::GetDiffStats) { } git_patch_free(patch); - result->Set(Nan::New("added").ToLocalChecked(), - Nan::New(added)); - result->Set(Nan::New("deleted").ToLocalChecked(), - Nan::New(deleted)); + Nan::Set(result, + Nan::New("added").ToLocalChecked(), + Nan::New(added)); + Nan::Set(result, + Nan::New("deleted").ToLocalChecked(), + Nan::New(deleted)); return info.GetReturnValue().Set(result); } @@ -705,8 +711,8 @@ class CompareCommitsWorker { std::pair, Local> Finish() { Local result = Nan::New(); - result->Set(Nan::New("ahead").ToLocalChecked(), Nan::New(ahead_count)); - result->Set(Nan::New("behind").ToLocalChecked(), Nan::New(behind_count)); + Nan::Set(result, Nan::New("ahead").ToLocalChecked(), Nan::New(ahead_count)); + Nan::Set(result, Nan::New("behind").ToLocalChecked(), Nan::New(behind_count)); return {Nan::Null(), result}; } @@ -789,8 +795,9 @@ NAN_METHOD(Repository::GetLineDiffs) { if (info.Length() >= 3) { Local optionsArg(Local::Cast(info[2])); Local ignoreEolWhitespace; - ignoreEolWhitespace = optionsArg->Get( - Nan::New("ignoreEolWhitespace").ToLocalChecked()); + ignoreEolWhitespace = Nan::Get( + optionsArg, + Nan::New("ignoreEolWhitespace").ToLocalChecked()).ToLocalChecked(); if (Nan::To(ignoreEolWhitespace).FromJust()) options.flags = GIT_DIFF_IGNORE_WHITESPACE_EOL; @@ -803,15 +810,19 @@ NAN_METHOD(Repository::GetLineDiffs) { Local v8Ranges = Nan::New(ranges.size()); for (size_t i = 0; i < ranges.size(); i++) { Local v8Range = Nan::New(); - v8Range->Set(Nan::New("oldStart").ToLocalChecked(), - Nan::New(ranges[i].old_start)); - v8Range->Set(Nan::New("oldLines").ToLocalChecked(), - Nan::New(ranges[i].old_lines)); - v8Range->Set(Nan::New("newStart").ToLocalChecked(), - Nan::New(ranges[i].new_start)); - v8Range->Set(Nan::New("newLines").ToLocalChecked(), - Nan::New(ranges[i].new_lines)); - v8Ranges->Set(i, v8Range); + Nan::Set(v8Range, + Nan::New("oldStart").ToLocalChecked(), + Nan::New(ranges[i].old_start)); + Nan::Set(v8Range, + Nan::New("oldLines").ToLocalChecked(), + Nan::New(ranges[i].old_lines)); + Nan::Set(v8Range, + Nan::New("newStart").ToLocalChecked(), + Nan::New(ranges[i].new_start)); + Nan::Set(v8Range, + Nan::New("newLines").ToLocalChecked(), + Nan::New(ranges[i].new_lines)); + Nan::Set(v8Ranges, i, v8Range); } git_blob_free(blob); return info.GetReturnValue().Set(v8Ranges); @@ -862,8 +873,9 @@ NAN_METHOD(Repository::GetLineDiffDetails) { if (info.Length() >= 3) { Local optionsArg(Local::Cast(info[2])); Local ignoreEolWhitespace; - ignoreEolWhitespace = optionsArg->Get( - Nan::New("ignoreEolWhitespace").ToLocalChecked()); + ignoreEolWhitespace = Nan::Get( + optionsArg, + Nan::New("ignoreEolWhitespace").ToLocalChecked()).ToLocalChecked(); if (Nan::To(ignoreEolWhitespace).FromJust()) options.flags = GIT_DIFF_IGNORE_WHITESPACE_EOL; @@ -877,24 +889,31 @@ NAN_METHOD(Repository::GetLineDiffDetails) { for (size_t i = 0; i < lineDiffs.size(); i++) { Local v8Range = Nan::New(); - v8Range->Set(Nan::New("oldLineNumber").ToLocalChecked(), - Nan::New(lineDiffs[i].line.old_lineno)); - v8Range->Set(Nan::New("newLineNumber").ToLocalChecked(), - Nan::New(lineDiffs[i].line.new_lineno)); - v8Range->Set(Nan::New("oldStart").ToLocalChecked(), - Nan::New(lineDiffs[i].hunk.old_start)); - v8Range->Set(Nan::New("newStart").ToLocalChecked(), - Nan::New(lineDiffs[i].hunk.new_start)); - v8Range->Set(Nan::New("oldLines").ToLocalChecked(), - Nan::New(lineDiffs[i].hunk.old_lines)); - v8Range->Set(Nan::New("newLines").ToLocalChecked(), - Nan::New(lineDiffs[i].hunk.new_lines)); - v8Range->Set(Nan::New("line").ToLocalChecked(), - Nan::New(lineDiffs[i].line.content, - lineDiffs[i].line.content_len) - .ToLocalChecked()); - - v8Ranges->Set(i, v8Range); + Nan::Set(v8Range, + Nan::New("oldLineNumber").ToLocalChecked(), + Nan::New(lineDiffs[i].line.old_lineno)); + Nan::Set(v8Range, + Nan::New("newLineNumber").ToLocalChecked(), + Nan::New(lineDiffs[i].line.new_lineno)); + Nan::Set(v8Range, + Nan::New("oldStart").ToLocalChecked(), + Nan::New(lineDiffs[i].hunk.old_start)); + Nan::Set(v8Range, + Nan::New("newStart").ToLocalChecked(), + Nan::New(lineDiffs[i].hunk.new_start)); + Nan::Set(v8Range, + Nan::New("oldLines").ToLocalChecked(), + Nan::New(lineDiffs[i].hunk.old_lines)); + Nan::Set(v8Range, + Nan::New("newLines").ToLocalChecked(), + Nan::New(lineDiffs[i].hunk.new_lines)); + Nan::Set(v8Range, + Nan::New("line").ToLocalChecked(), + Nan::New(lineDiffs[i].line.content, + lineDiffs[i].line.content_len) + .ToLocalChecked()); + + Nan::Set(v8Ranges, i, v8Range); } git_blob_free(blob); return info.GetReturnValue().Set(v8Ranges); @@ -909,7 +928,7 @@ Local Repository::ConvertStringVectorToV8Array( size_t i = 0, size = vector.size(); Local array = Nan::New(size); for (i = 0; i < size; i++) - array->Set(i, Nan::New(vector[i].c_str()).ToLocalChecked()); + Nan::Set(array, i, Nan::New(vector[i].c_str()).ToLocalChecked()); return array; } @@ -933,12 +952,15 @@ NAN_METHOD(Repository::GetReferences) { git_strarray_free(&strarray); - references->Set(Nan::New("heads").ToLocalChecked(), - ConvertStringVectorToV8Array(heads)); - references->Set(Nan::New("remotes").ToLocalChecked(), - ConvertStringVectorToV8Array(remotes)); - references->Set(Nan::New("tags").ToLocalChecked(), - ConvertStringVectorToV8Array(tags)); + Nan::Set(references, + Nan::New("heads").ToLocalChecked(), + ConvertStringVectorToV8Array(heads)); + Nan::Set(references, + Nan::New("remotes").ToLocalChecked(), + ConvertStringVectorToV8Array(remotes)); + Nan::Set(references, + Nan::New("tags").ToLocalChecked(), + ConvertStringVectorToV8Array(tags)); info.GetReturnValue().Set(references); } From eb2e292d3819ae717964cd1fdcc395200d159283 Mon Sep 17 00:00:00 2001 From: Darangi Date: Wed, 27 Nov 2019 17:48:46 +0100 Subject: [PATCH 175/194] :arrow_up: git-utils@5.6.2 --- package-lock.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8df10a4a..9652a54a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -173,7 +173,7 @@ "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, "cli-cursor": { @@ -374,7 +374,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -764,7 +764,7 @@ "eslint-config-standard-jsx": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-4.0.2.tgz", - "integrity": "sha1-AJ5TxN2x6e5wtGUP/mOn85+INuE=", + "integrity": "sha512-F8fRh2WFnTek7dZH9ZaE0PCBwdVGkwVWZmizla/DDNOmg7Tx6B/IlK5+oYpiX29jpu73LszeJj5i1axEZv6VMw==", "dev": true }, "eslint-import-resolver-node": { @@ -857,7 +857,7 @@ "eslint-plugin-node": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-4.2.3.tgz", - "integrity": "sha1-wEOQq428u2iHF0Aj1vOnJ2nmO5c=", + "integrity": "sha512-vIUQPuwbVYdz/CYnlTLsJrRy7iXHQjdEe5wz0XhhdTym3IInM/zZLlPf9nZ2mThsH0QcsieCOWs2vOeCy/22LQ==", "dev": true, "requires": { "ignore": "^3.0.11", @@ -1042,7 +1042,7 @@ "find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha1-q8/Iunb3CMQql7PWhbfpRQv7nOQ=", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", "dev": true }, "find-up": { @@ -1219,7 +1219,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "gaze": { @@ -1275,7 +1275,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true }, "globby": { @@ -2207,7 +2207,7 @@ "standard": { "version": "10.0.3", "resolved": "https://registry.npmjs.org/standard/-/standard-10.0.3.tgz", - "integrity": "sha1-eGm8v0Ir3uqraJof+x/qlnfdUOo=", + "integrity": "sha512-JURZ+85ExKLQULckDFijdX5WHzN6RC7fgiZNSV4jFQVo+3tPoQGHyBrGekye/yf0aOfb4210EM5qPNlc2cRh4w==", "dev": true, "requires": { "eslint": "~3.19.0", @@ -2338,7 +2338,7 @@ "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", diff --git a/package.json b/package.json index 06cd5e6b..bec3018e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.6.1", + "version": "5.6.2", "license": "MIT", "author": { "name": "Kevin Sawicki", From d2cb646fc5a829e289c59ef29c8bde89aa64f5d2 Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Tue, 3 Nov 2020 18:35:41 +0530 Subject: [PATCH 176/194] git-diff: Add support for ignoreChangeWhitespace & ignoreWhitespace (#100) * git-diff: Add support for ignoreChangeWhitespace & ignoreWhitespace --- README.md | 8 +- spec/fixtures/file.txt | 4 +- spec/fixtures/whitespace.git/config | 2 +- spec/fixtures/whitespace.git/index | Bin 104 -> 137 bytes .../32/7dcd4d73d1d555ed7c3339809aadc584b16e11 | Bin 53 -> 0 bytes .../5f/6a1c992cfafadd97053fae380aef21a964621a | Bin 0 -> 790 bytes .../9e/9f22baaf485ce95df8de089024e5fa13bc7fb4 | Bin 0 -> 53 bytes .../de/14a8e29deb59e93d6daa82b1c55413581017a1 | Bin 134 -> 0 bytes .../e2/81c6b8b1c5b44193540a0dc1ada9957d07677c | Bin 0 -> 37 bytes .../ff/6e6b1a505523bd4c9af36bd9d70d136872b225 | Bin 35 -> 0 bytes .../fixtures/whitespace.git/refs/heads/master | 2 +- spec/git-spec.js | 144 +++++++++++++++++- src/repository.cc | 38 +++-- 13 files changed, 172 insertions(+), 26 deletions(-) delete mode 100644 spec/fixtures/whitespace.git/objects/32/7dcd4d73d1d555ed7c3339809aadc584b16e11 create mode 100644 spec/fixtures/whitespace.git/objects/5f/6a1c992cfafadd97053fae380aef21a964621a create mode 100644 spec/fixtures/whitespace.git/objects/9e/9f22baaf485ce95df8de089024e5fa13bc7fb4 delete mode 100644 spec/fixtures/whitespace.git/objects/de/14a8e29deb59e93d6daa82b1c55413581017a1 create mode 100644 spec/fixtures/whitespace.git/objects/e2/81c6b8b1c5b44193540a0dc1ada9957d07677c delete mode 100644 spec/fixtures/whitespace.git/objects/ff/6e6b1a505523bd4c9af36bd9d70d136872b225 diff --git a/README.md b/README.md index 461ce7e5..805b809d 100644 --- a/README.md +++ b/README.md @@ -145,8 +145,12 @@ text. `options` - An optional object with the following keys: - * `ignoreEolWhitespace` - `true` to ignore any whitespace diffs at the end of - lines. + * `ignoreEolWhitespace` - `true` to ignore changes in whitespace at the end of lines. + * `ignoreWhitespaceChange` - `true` to ignore changes in amount of whitespace. + This ignores whitespace at line end, and considers all other sequences of + one or more whitespace characters to be equivalent. + * `ignoreWhitespace` - `true` to ignore whitespace when comparing lines. + This ignores differences even if one line has whitespace where the other line has none. * `useIndex` - `true` to compare against the index version instead of the HEAD version. diff --git a/spec/fixtures/file.txt b/spec/fixtures/file.txt index ff6e6b1a..e281c6b8 100644 --- a/spec/fixtures/file.txt +++ b/spec/fixtures/file.txt @@ -1,3 +1,3 @@ first -second -third + second + third diff --git a/spec/fixtures/whitespace.git/config b/spec/fixtures/whitespace.git/config index bb4d11c1..6c9406b7 100644 --- a/spec/fixtures/whitespace.git/config +++ b/spec/fixtures/whitespace.git/config @@ -4,4 +4,4 @@ bare = false logallrefupdates = true ignorecase = true - precomposeunicode = false + precomposeunicode = true diff --git a/spec/fixtures/whitespace.git/index b/spec/fixtures/whitespace.git/index index fa597b62c5ccae8d9d03f92f3415d5a674ef7209..86dc73090b33e3b0908067e7f619446a73202179 100644 GIT binary patch literal 137 zcmZ?q402{*U|<4b#`rmXcU9M}SO}t3x(f^#85r0Yn%Gzw7#f!VrGc111c*f+H6Gis z@#q%E$st_42iLBgTFahZ!@!Z2nUktlQc=Rd5EA6-3REY_V5nfgHE+JsuJs-9V=y!@Ff%bxNXyJg)hnqeVfdeyEfo-|yw_*e=j@x;d4)5I LHmL#tJrxi04iFWE diff --git a/spec/fixtures/whitespace.git/objects/5f/6a1c992cfafadd97053fae380aef21a964621a b/spec/fixtures/whitespace.git/objects/5f/6a1c992cfafadd97053fae380aef21a964621a new file mode 100644 index 0000000000000000000000000000000000000000..73620c1372cab87e7cda6d4f108caeb96e078351 GIT binary patch literal 790 zcmV+x1L^#D0i~0<(xXNIgdOt~ldHUdIH$_%@*qwL5D1W1G8l$K0&xh0;OYIZx12e1 zXZ;1;NjL7=ww?gX2+VKONC9&tKjvSy{OMRu`m1cyy7`8?_D{fy4A1fmx97o*5jckWqF>z;`ClPr zU%u)R{QgslW>_xp3=agB;i53QX#a2uP@wj$O+iRGAe8I1re*ELRhPtk4R&&jO~&uu zP)_nBg^P}wUG4=wI+PFpUrvD(Zi`vcbS{>x`6^7uV=tng1y0x+80P31x@WVEX&VwV zAiTOn$m8<^T@<|e`0+s$xLPZAKDam~LB-}_pBVIkttQkvl82M?kAxPF`XT9L^{IHG ztX`gl6At$_zF!QwQdbJFCBNq8Tknry^IT>WUoSS-U%d;fxO^QbL%2>edl#9vd>F2F zhxqZq3h!2c+sP~GoC2#l`9^i+nf-1lT_ul?#2*?5zgMCkF3c=Pf#Sv1-3|>pETbVT z?B{@%+24y^9!eSocEjoF_%JR6B_1IgxpQL}y*tN!=QEZfZF9SflYW%Kts{&7UWF`+ zqJasuyA_feoNiST5tC&Q{yeh z+T=RS6=MpVpB(DqZQoX}V|8olS&akB#&@wj+Ze;OHvO$|rMh?wA7kLS@Epg7@XBq6+)HQ;B^ll;@ zSZqWAXYIAmQ@vqgToID)gJ^KKjr1d}>%B&654xVtqP;zQT=KP=Hv2qRy4NjEkK=SQ zzxHr&$a@btEO_*6PpjgxQa#?|jflEGrTHc{MA;(2f{fJ^QL$Ur7fh#T@TLp#Hun+* zNQPq!Nm`3*l|*o0O}#Xvg_a4Cx@Ff(Ba-_W&O8j?x~!I>j32)2Q!4Uvjjo=*@z;5c)bp;}5- zz&I>)76G>kOx$yDjO@J^4&GZAU1C5nFH>~nKcK`qY diff --git a/spec/fixtures/whitespace.git/objects/e2/81c6b8b1c5b44193540a0dc1ada9957d07677c b/spec/fixtures/whitespace.git/objects/e2/81c6b8b1c5b44193540a0dc1ada9957d07677c new file mode 100644 index 0000000000000000000000000000000000000000..078a766118c29d0e927b3c891b922c652a30fe7f GIT binary patch literal 37 tcmbzL+1}pO#mcP55NEb literal 0 HcmV?d00001 diff --git a/spec/fixtures/whitespace.git/objects/ff/6e6b1a505523bd4c9af36bd9d70d136872b225 b/spec/fixtures/whitespace.git/objects/ff/6e6b1a505523bd4c9af36bd9d70d136872b225 deleted file mode 100644 index f8b201864580ee79dedf1cb9f3a8de6ca1789f8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 35 rcmb { expect(diffs).toBeNull() }) - describe('ignoreEolWhitespace option', () => { + describe('ignoreSpaceAtEOL option', () => { it('ignores eol of line whitespace changes', () => { repo = git.open(path.join(__dirname, 'fixtures/whitespace.git')) - let diffs = repo.getLineDiffs('file.txt', 'first\r\nsecond\r\nthird\r\n', {ignoreEolWhitespace: false}) + let diffs = repo.getLineDiffs('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreEolWhitespace: false}) expect(diffs.length).toBe(1) - diffs = repo.getLineDiffs('file.txt', 'first\r\nsecond\r\nthird\r\n', {ignoreEolWhitespace: true}) + diffs = repo.getLineDiffs('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreEolWhitespace: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffs('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreSpaceAtEOL: false}) + expect(diffs.length).toBe(1) + + diffs = repo.getLineDiffs('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreSpaceAtEOL: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffs('file.txt', 'first\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceAtEOL: false}) + expect(diffs.length).toBe(1) + + diffs = repo.getLineDiffs('file.txt', 'first\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceAtEOL: true}) + expect(diffs.length).toBe(1) + + diffs = repo.getLineDiffs('file.txt', ' \tfirst\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceAtEOL: false}) + expect(diffs.length).toBe(1) + + diffs = repo.getLineDiffs('file.txt', ' \tfirst\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceAtEOL: true}) + expect(diffs.length).toBe(1) + }) + }) + + describe('ignoreSpaceChange option', () => { + it('ignores whitespace changes', () => { + repo = git.open(path.join(__dirname, 'fixtures/whitespace.git')) + + let diffs = repo.getLineDiffs('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreSpaceChange: false}) + expect(diffs.length).toBe(1) + + diffs = repo.getLineDiffs('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreSpaceChange: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffs('file.txt', 'first\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceChange: false}) + expect(diffs.length).toBe(1) + + diffs = repo.getLineDiffs('file.txt', 'first\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceChange: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffs('file.txt', ' \tfirst\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceChange: false}) + expect(diffs.length).toBe(1) + + diffs = repo.getLineDiffs('file.txt', ' \tfirst\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceChange: true}) + expect(diffs.length).toBe(1) + }) + }) + + describe('ignoreAllSpace option', () => { + it('ignores whitespace', () => { + repo = git.open(path.join(__dirname, 'fixtures/whitespace.git')) + + let diffs = repo.getLineDiffs('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreAllSpace: false}) + expect(diffs.length).toBe(1) + + diffs = repo.getLineDiffs('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreAllSpace: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffs('file.txt', 'first\r\n \tsecond\r\n \tthird\r\n', {ignoreAllSpace: false}) + expect(diffs.length).toBe(1) + + diffs = repo.getLineDiffs('file.txt', 'first\r\n \tsecond\r\n \tthird\r\n', {ignoreAllSpace: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffs('file.txt', ' \tfirst\r\n \tsecond\r\n \tthird\r\n', {ignoreAllSpace: false}) + expect(diffs.length).toBe(1) + + diffs = repo.getLineDiffs('file.txt', ' \tfirst\r\n \tsecond\r\n \tthird\r\n', {ignoreAllSpace: true}) expect(diffs.length).toBe(0) }) }) @@ -811,14 +877,80 @@ describe('git', () => { expect(diffs).toBeNull() }) - describe('ignoreEolWhitespace option', () => { + describe('ignoreSpaceAtEOL option', () => { it('ignores eol of line whitespace changes', () => { repo = git.open(path.join(__dirname, 'fixtures/whitespace.git')) - let diffs = repo.getLineDiffDetails('file.txt', 'first\r\nsecond\r\nthird\r\n', {ignoreEolWhitespace: false}) + let diffs = repo.getLineDiffDetails('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreEolWhitespace: false}) + expect(diffs.length).toBe(6) + + diffs = repo.getLineDiffDetails('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreEolWhitespace: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffDetails('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreSpaceAtEOL: false}) + expect(diffs.length).toBe(6) + + diffs = repo.getLineDiffDetails('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreSpaceAtEOL: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffDetails('file.txt', 'first\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceAtEOL: false}) + expect(diffs.length).toBe(6) + + diffs = repo.getLineDiffDetails('file.txt', 'first\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceAtEOL: true}) + expect(diffs.length).toBe(4) + + diffs = repo.getLineDiffDetails('file.txt', ' \tfirst\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceAtEOL: false}) + expect(diffs.length).toBe(6) + + diffs = repo.getLineDiffDetails('file.txt', ' \tfirst\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceAtEOL: true}) + expect(diffs.length).toBe(6) + }) + }) + + describe('ignoreSpaceChange option', () => { + it('ignores whitespace changes', () => { + repo = git.open(path.join(__dirname, 'fixtures/whitespace.git')) + + let diffs = repo.getLineDiffDetails('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreSpaceChange: false}) + expect(diffs.length).toBe(6) + + diffs = repo.getLineDiffDetails('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreSpaceChange: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffDetails('file.txt', 'first\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceChange: false}) + expect(diffs.length).toBe(6) + + diffs = repo.getLineDiffDetails('file.txt', 'first\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceChange: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffDetails('file.txt', ' \tfirst\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceChange: false}) + expect(diffs.length).toBe(6) + + diffs = repo.getLineDiffDetails('file.txt', ' \tfirst\r\n \tsecond\r\n \tthird\r\n', {ignoreSpaceChange: true}) + expect(diffs.length).toBe(2) + }) + }) + + describe('ignoreAllSpace option', () => { + it('ignores whitespace', () => { + repo = git.open(path.join(__dirname, 'fixtures/whitespace.git')) + + let diffs = repo.getLineDiffDetails('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreAllSpace: false}) + expect(diffs.length).toBe(6) + + diffs = repo.getLineDiffDetails('file.txt', 'first\r\n second\r\n\tthird\r\n', {ignoreAllSpace: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffDetails('file.txt', 'first\r\n \tsecond\r\n \tthird\r\n', {ignoreAllSpace: false}) + expect(diffs.length).toBe(6) + + diffs = repo.getLineDiffDetails('file.txt', 'first\r\n \tsecond\r\n \tthird\r\n', {ignoreAllSpace: true}) + expect(diffs.length).toBe(0) + + diffs = repo.getLineDiffDetails('file.txt', ' \tfirst\r\n \tsecond\r\n \tthird\r\n', {ignoreAllSpace: false}) expect(diffs.length).toBe(6) - diffs = repo.getLineDiffs('file.txt', 'first\r\nsecond\r\nthird\r\n', {ignoreEolWhitespace: true}) + diffs = repo.getLineDiffDetails('file.txt', ' \tfirst\r\n \tsecond\r\n \tthird\r\n', {ignoreAllSpace: true}) expect(diffs.length).toBe(0) }) }) diff --git a/src/repository.cc b/src/repository.cc index 90eef52b..fb995f05 100644 --- a/src/repository.cc +++ b/src/repository.cc @@ -791,16 +791,21 @@ NAN_METHOD(Repository::GetLineDiffs) { std::vector ranges; git_diff_options options = CreateDefaultGitDiffOptions(); - // Set GIT_DIFF_IGNORE_WHITESPACE_EOL when ignoreEolWhitespace: true if (info.Length() >= 3) { Local optionsArg(Local::Cast(info[2])); - Local ignoreEolWhitespace; - ignoreEolWhitespace = Nan::Get( - optionsArg, - Nan::New("ignoreEolWhitespace").ToLocalChecked()).ToLocalChecked(); - - if (Nan::To(ignoreEolWhitespace).FromJust()) + // Set GIT_DIFF_IGNORE_WHITESPACE when ignoreWhitespace: true + if (Nan::To(Nan::Get(optionsArg, Nan::New("ignoreAllSpace").ToLocalChecked()).ToLocalChecked()).FromJust()) + options.flags = GIT_DIFF_IGNORE_WHITESPACE; + // Set GIT_DIFF_IGNORE_WHITESPACE_CHANGE when ignoreWhitespaceChange: true + else if (Nan::To(Nan::Get(optionsArg, Nan::New("ignoreSpaceChange").ToLocalChecked()).ToLocalChecked()).FromJust()) + options.flags = GIT_DIFF_IGNORE_WHITESPACE_CHANGE; + // Set GIT_DIFF_IGNORE_WHITESPACE_EOL when ignoreEolWhitespace: true + else if (Nan::To(Nan::Get(optionsArg, Nan::New("ignoreSpaceAtEOL").ToLocalChecked()).ToLocalChecked()).FromJust() + || Nan::To(Nan::Get(optionsArg, Nan::New("ignoreEolWhitespace").ToLocalChecked()).ToLocalChecked()).FromJust()) options.flags = GIT_DIFF_IGNORE_WHITESPACE_EOL; + // Set GIT_DIFF_NORMAL when none of the above are defined + else + options.flags = GIT_DIFF_NORMAL; } options.context_lines = 0; @@ -869,16 +874,21 @@ NAN_METHOD(Repository::GetLineDiffDetails) { std::vector lineDiffs; git_diff_options options = CreateDefaultGitDiffOptions(); - // Set GIT_DIFF_IGNORE_WHITESPACE_EOL when ignoreEolWhitespace: true if (info.Length() >= 3) { Local optionsArg(Local::Cast(info[2])); - Local ignoreEolWhitespace; - ignoreEolWhitespace = Nan::Get( - optionsArg, - Nan::New("ignoreEolWhitespace").ToLocalChecked()).ToLocalChecked(); - - if (Nan::To(ignoreEolWhitespace).FromJust()) + // Set GIT_DIFF_IGNORE_WHITESPACE when ignoreWhitespace: true + if (Nan::To(Nan::Get(optionsArg, Nan::New("ignoreAllSpace").ToLocalChecked()).ToLocalChecked()).FromJust()) + options.flags = GIT_DIFF_IGNORE_WHITESPACE; + // Set GIT_DIFF_IGNORE_WHITESPACE_CHANGE when ignoreWhitespaceChange: true + else if (Nan::To(Nan::Get(optionsArg, Nan::New("ignoreSpaceChange").ToLocalChecked()).ToLocalChecked()).FromJust()) + options.flags = GIT_DIFF_IGNORE_WHITESPACE_CHANGE; + // Set GIT_DIFF_IGNORE_WHITESPACE_EOL when ignoreEolWhitespace: true + else if (Nan::To(Nan::Get(optionsArg, Nan::New("ignoreSpaceAtEOL").ToLocalChecked()).ToLocalChecked()).FromJust() + || Nan::To(Nan::Get(optionsArg, Nan::New("ignoreEolWhitespace").ToLocalChecked()).ToLocalChecked()).FromJust()) options.flags = GIT_DIFF_IGNORE_WHITESPACE_EOL; + // Set GIT_DIFF_NORMAL when none of the above are defined + else + options.flags = GIT_DIFF_NORMAL; } options.context_lines = 0; From 407f34ebf17dd6b252463a9f2ee7331b5f5088f6 Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Mon, 7 Dec 2020 23:09:21 +0530 Subject: [PATCH 177/194] git-diff: Update README (#101) --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 805b809d..1405ecba 100644 --- a/README.md +++ b/README.md @@ -145,11 +145,12 @@ text. `options` - An optional object with the following keys: - * `ignoreEolWhitespace` - `true` to ignore changes in whitespace at the end of lines. - * `ignoreWhitespaceChange` - `true` to ignore changes in amount of whitespace. + * `ignoreSpaceAtEOL` - `true` to ignore changes in whitespace at the end of lines. + (ignoreEolWhitespace also works.) + * `ignoreSpaceChange` - `true` to ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent. - * `ignoreWhitespace` - `true` to ignore whitespace when comparing lines. + * `ignoreAllSpace` - `true` to ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none. * `useIndex` - `true` to compare against the index version instead of the HEAD version. From 86b38eb0cd1d9c22c255b44326c972c621c45aea Mon Sep 17 00:00:00 2001 From: sadick254 Date: Mon, 7 Dec 2020 20:42:06 +0300 Subject: [PATCH 178/194] 5.7.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9652a54a..000f96e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.6.1", + "version": "5.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bec3018e..f43592a5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.6.2", + "version": "5.7.0", "license": "MIT", "author": { "name": "Kevin Sawicki", From d6be34b8d692601f92642c1833dfae7cada7ca58 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 30 Dec 2020 16:07:28 -0600 Subject: [PATCH 179/194] fix: use prepare to init the submodule --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f43592a5..acbaa7c6 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,8 @@ "fs-plus": "^3.0.0" }, "scripts": { - "prepublish": "standard src spec", - "test": "jasmine-focused --captureExceptions spec" + "lint": "standard src spec", + "test": "jasmine-focused --captureExceptions spec", + "prepare": "git submodule update --init --recursive" } } From 409bff86d02bb685d403913294c7f13946f8fe1e Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 30 Dec 2020 18:31:05 -0600 Subject: [PATCH 180/194] Emphesize running `npm run prepare` for development --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1405ecba..1d5a341f 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ Helpers for working with Git repositories built natively on top of npm install git-utils ``` -## Building - * Clone the repository with the `--recurse` option to get the libgit2 - submodule +## Development + * Clone the repository + * Run `npm run prepare` to get the submodule * Run `npm install` * Run `npm test` to run the specs From 8f9cc2bd00335c0934b9e641d9a11d9ee196a39e Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 30 Dec 2020 18:39:26 -0600 Subject: [PATCH 181/194] fix CI script --- .travis.yml | 11 ++++++++--- appveyor.yml | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9c5365c8..fe0a5e03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,6 @@ git: depth: 10 submodules: false -before_install: - - git submodule update --init - branches: only: - master @@ -22,3 +19,11 @@ sudo: false env: - CC=clang CXX=clang++ npm_config_clang=1 + +install: + - npm run prepare + - npm install + +script: + - npm run lint + - npm run test diff --git a/appveyor.yml b/appveyor.yml index ad2f646a..b0a1d03d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,11 +11,11 @@ clone_depth: 10 skip_tags: true install: - - git submodule update --init - ps: Install-Product node 6 + - npm run prepare - npm install + - npm run lint build: off test: off deploy: off - From cc9ecf9593bcb674cc9869004e4b508365509e58 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 30 Dec 2020 18:46:42 -0600 Subject: [PATCH 182/194] Fix `jasmine-focused does not contain a package.json file` --- package-lock.json | 1641 +++++++++++++++++---------------------------- 1 file changed, 616 insertions(+), 1025 deletions(-) diff --git a/package-lock.json b/package-lock.json index 000f96e4..208425bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "acorn": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.2.tgz", - "integrity": "sha512-o96FZLJBPY1lvTuJylGA9Bk3t/GKPPJG8H0ydQQl01crzwJgspa4AEIq/pVTXigmK0PHVQhiAtn8WMBLL9D2WA==", + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", "dev": true }, "acorn-jsx": { @@ -44,9 +44,9 @@ "dev": true }, "amdefine": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz", - "integrity": "sha1-/RdHRwDLXMnCtwnwvp0jzjwZjDM=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true }, "ansi-escapes": { @@ -61,35 +61,35 @@ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "array-uniq": "^1.0.1" + "sprintf-js": "~1.0.2" } }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, "array.prototype.find": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.0.4.tgz", - "integrity": "sha1-VWpcU2LAhkgyPdrrnenRS8GGTJA=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.1.1.tgz", + "integrity": "sha512-mi+MYNJYLTx2eNYy+Yh6raoQacCsNeeMUaspFPh9Y141lFSsWxxB8V9mM2ye+eqiRs917J6/pJ4M9ZPzenWckA==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.7.0" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.4" } }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, "babel-code-frame": { @@ -101,60 +101,46 @@ "chalk": "^1.1.3", "esutils": "^2.0.2", "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } } }, "balanced-match": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "brace-expansion": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", - "integrity": "sha1-cZfX6qm4fmSDkOph/GbIRCdCDfk=", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "^0.4.1", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", + "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.0" + } + }, "caller-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", @@ -170,6 +156,19 @@ "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", @@ -186,9 +185,9 @@ } }, "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, "co": { @@ -204,38 +203,22 @@ "dev": true }, "coffee-script": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", - "integrity": "sha1-FQ1rTLUiiUNp7+1qIQHCC8f0pPQ=", + "version": "1.12.7", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.7.tgz", + "integrity": "sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw==", "dev": true }, "coffeestack": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/coffeestack/-/coffeestack-1.1.2.tgz", - "integrity": "sha1-NSePO+uc5vXQraH7bgh4UrZXzpg=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/coffeestack/-/coffeestack-1.2.0.tgz", + "integrity": "sha512-vXT7ZxSZ4lXHh/0A2cODyFqrVIl4Vb0Er5wcS2SrFN4jW8g1qIAmcMsRlRdUKvnvfmKixvENYspAyF/ihWbpyw==", "dev": true, "requires": { "coffee-script": "~1.8.0", - "fs-plus": "^2.5.0", + "fs-plus": "^3.1.1", "source-map": "~0.1.43" }, "dependencies": { - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "coffee-script": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.8.0.tgz", @@ -246,9 +229,9 @@ } }, "fs-plus": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/fs-plus/-/fs-plus-2.10.1.tgz", - "integrity": "sha1-MgR4HXhAYR5jZOe2+wWMljJ8WqU=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fs-plus/-/fs-plus-3.1.1.tgz", + "integrity": "sha512-Se2PJdOWXqos1qVTkvqqjb0CSnfBnwwD+pq+z4ksT+e97mEShod/hrNg0TRCCsXPbJzcIq+NuzQhigunMWMJUA==", "dev": true, "requires": { "async": "^1.5.2", @@ -257,78 +240,21 @@ "underscore-plus": "1.x" }, "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "^7.0.5" - } - }, - "underscore-plus": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.6.6.tgz", - "integrity": "sha1-ZezeG9xEGjXYnmUP1w3PE65Dmn0=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "underscore": "~1.6.0" + "minimist": "^1.2.5" } } } }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "underscore": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "mkdirp": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=", "dev": true } } @@ -340,11 +266,12 @@ "dev": true }, "concat-stream": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", - "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { + "buffer-from": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^2.2.2", "typedarray": "^0.0.6" @@ -363,12 +290,13 @@ "dev": true }, "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", "dev": true, "requires": { - "es5-ext": "^0.10.9" + "es5-ext": "^0.10.50", + "type": "^1.0.1" } }, "debug": { @@ -393,19 +321,18 @@ "dev": true }, "define-properties": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", - "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, "requires": { - "foreach": "^2.0.5", - "object-keys": "^1.0.8" + "object-keys": "^1.0.12" } }, "deglob": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.0.tgz", - "integrity": "sha1-TUSr4W7zLHebSXK9FBqAMlApoUo=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.1.tgz", + "integrity": "sha512-2kjwuGGonL7gWE1XU4Fv79+vVzpoQCl0V+boMwWtOQJV2AGDabCwez++nB1Nli/8BabAfZQ/UuHPlp6AymKdWw==", "dev": true, "requires": { "find-root": "^1.0.0", @@ -414,126 +341,76 @@ "pkg-config": "^1.1.0", "run-parallel": "^1.1.2", "uniq": "^1.0.1" - }, - "dependencies": { - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, - "del": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", - "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", - "dev": true, - "requires": { - "globby": "^5.0.0", - "is-path-cwd": "^1.0.0", - "is-path-in-cwd": "^1.0.0", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "rimraf": "^2.2.8" } }, "doctrine": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", - "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" + "esutils": "^2.0.2" } }, "error-ex": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "^0.2.1" } }, "es-abstract": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.8.2.tgz", - "integrity": "sha512-dvhwFL3yjQxNNsOWx6exMlaDrRHCRGMQlnx5lsXDCZ/J7G/frgIIl94zhZSp/galVAYp7VzPi1OrAHta89/yGQ==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { - "es-to-primitive": "^1.1.1", + "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", - "has": "^1.0.1", - "is-callable": "^1.1.3", - "is-regex": "^1.0.4" + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" } }, "es-to-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", - "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "requires": { - "is-callable": "^1.1.1", + "is-callable": "^1.1.4", "is-date-object": "^1.0.1", - "is-symbol": "^1.0.1" + "is-symbol": "^1.0.2" } }, "es5-ext": { - "version": "0.10.30", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.30.tgz", - "integrity": "sha1-cUGhaDZpfbq/qq7uQUlc4p9SyTk=", + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", "dev": true, "requires": { - "es6-iterator": "2", - "es6-symbol": "~3.1" + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" } }, "es6-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "dev": true, "requires": { "d": "1", - "es5-ext": "^0.10.14", - "es6-symbol": "^3.1" + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" } }, "es6-map": { @@ -561,27 +438,39 @@ "es6-iterator": "~2.0.1", "es6-symbol": "3.1.1", "event-emitter": "~0.3.5" + }, + "dependencies": { + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + } } }, "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", "dev": true, "requires": { - "d": "1", - "es5-ext": "~0.10.14" + "d": "^1.0.1", + "ext": "^1.1.2" } }, "es6-weak-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", - "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", "dev": true, "requires": { "d": "1", - "es5-ext": "^0.10.14", - "es6-iterator": "^2.0.1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", "es6-symbol": "^3.1.1" } }, @@ -644,115 +533,6 @@ "table": "^3.7.8", "text-table": "~0.2.0", "user-home": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "argparse": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", - "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "esprima": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", - "dev": true - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "js-yaml": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", - "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } } }, "eslint-config-standard": { @@ -776,27 +556,16 @@ "debug": "^2.2.0", "object-assign": "^4.0.1", "resolve": "^1.1.6" - }, - "dependencies": { - "resolve": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", - "dev": true, - "requires": { - "path-parse": "^1.0.5" - } - } } }, "eslint-module-utils": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz", - "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", "dev": true, "requires": { - "debug": "^2.6.8", - "pkg-dir": "^1.0.0" + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" } }, "eslint-plugin-import": { @@ -817,22 +586,6 @@ "pkg-up": "^1.0.0" }, "dependencies": { - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "doctrine": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", @@ -842,15 +595,6 @@ "esutils": "^2.0.2", "isarray": "^1.0.0" } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } } } }, @@ -865,42 +609,6 @@ "object-assign": "^4.0.1", "resolve": "^1.1.7", "semver": "5.3.0" - }, - "dependencies": { - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "resolve": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", - "dev": true, - "requires": { - "path-parse": "^1.0.5" - } - } } }, "eslint-plugin-promise": { @@ -941,44 +649,65 @@ "dev": true }, "espree": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.1.tgz", - "integrity": "sha1-DJiLirRttTEAoZVK5LqZXd0n2H4=", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { - "acorn": "^5.1.1", + "acorn": "^5.5.0", "acorn-jsx": "^3.0.0" } }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, "esquery": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", - "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", "dev": true, "requires": { - "estraverse": "^4.0.0" + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } } }, "esrecurse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", - "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "requires": { - "estraverse": "^4.1.0", - "object-assign": "^4.0.1" + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } } }, "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, "event-emitter": { @@ -991,18 +720,29 @@ "es5-ext": "~0.10.14" } }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true - }, "exit-hook": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", "dev": true }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", + "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==", + "dev": true + } + } + }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", @@ -1037,6 +777,40 @@ "requires": { "glob": "3.x", "minimatch": "0.x" + }, + "dependencies": { + "glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", + "dev": true, + "requires": { + "inherits": "2", + "minimatch": "0.3" + }, + "dependencies": { + "minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + } + } + }, + "minimatch": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.4.0.tgz", + "integrity": "sha1-vSx9Bg0sjI/Xzefx8u0tWycP2xs=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + } } }, "find-root": { @@ -1046,41 +820,26 @@ "dev": true }, "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" + "locate-path": "^2.0.0" } }, "flat-cache": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", - "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", + "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", "dev": true, "requires": { "circular-json": "^0.3.1", - "del": "^2.0.2", "graceful-fs": "^4.1.2", + "rimraf": "~2.6.2", "write": "^0.2.1" - }, - "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - } } }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, "fs-plus": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/fs-plus/-/fs-plus-3.0.1.tgz", @@ -1156,17 +915,12 @@ "brace-expansion": "^1.1.7" } }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } }, "once": { @@ -1230,13 +984,28 @@ "requires": { "fileset": "~0.1.5", "minimatch": "~0.2.9" + }, + "dependencies": { + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + } } }, "generate-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", - "dev": true + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dev": true, + "requires": { + "is-property": "^1.0.2" + } }, "generate-object-property": { "version": "1.2.0", @@ -1247,6 +1016,17 @@ "is-property": "^1.0.0" } }, + "get-intrinsic": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz", + "integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, "get-stdin": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", @@ -1254,22 +1034,17 @@ "dev": true }, "glob": { - "version": "3.1.21", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", - "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { - "graceful-fs": "~1.2.0", - "inherits": "1", - "minimatch": "~0.2.11" - }, - "dependencies": { - "inherits": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", - "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", - "dev": true - } + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "globals": { @@ -1278,74 +1053,19 @@ "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true }, - "globby": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", - "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, "graceful-fs": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", - "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, "has": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", - "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { - "function-bind": "^1.0.2" + "function-bind": "^1.1.1" } }, "has-ansi": { @@ -1357,10 +1077,16 @@ "ansi-regex": "^2.0.0" } }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, "ignore": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.5.tgz", - "integrity": "sha512-JLH93mL8amZQhh/p6mfQgVBH3M6epNq3DfsXsTSuSrInVjwyYlFE1nv2AgfRCC8PoOhM0jwQ5v8s9LgbK7yGDw==", + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", "dev": true }, "imurmurhash": { @@ -1370,9 +1096,9 @@ "dev": true }, "inflight": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", - "integrity": "sha1-2zIEzVqd4ubNiQuFxuL2a89PYgo=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { "once": "^1.3.0", @@ -1380,9 +1106,9 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "inquirer": { @@ -1404,48 +1130,12 @@ "string-width": "^1.0.1", "strip-ansi": "^3.0.0", "through": "^2.3.6" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } } }, "interpret": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.4.tgz", - "integrity": "sha1-ggzdWIuGj/sZGoCVBtbJyPISsbA=", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, "is-arrayish": { @@ -1455,15 +1145,24 @@ "dev": true }, "is-callable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", - "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", "dev": true }, + "is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, "is-fullwidth-code-point": { @@ -1475,42 +1174,25 @@ "number-is-nan": "^1.0.0" } }, + "is-my-ip-valid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", + "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", + "dev": true + }, "is-my-json-valid": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz", - "integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==", + "version": "2.20.5", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.5.tgz", + "integrity": "sha512-VTPuvvGQtxvCeghwspQu1rBgjYUT6FGxPlvFKbYuFtgc4ADsX3U5ihZOYN0qyU6u+d4X9xXb0IT5O6QpXKt87A==", "dev": true, "requires": { "generate-function": "^2.0.0", "generate-object-property": "^1.1.0", + "is-my-ip-valid": "^1.0.0", "jsonpointer": "^4.0.0", "xtend": "^4.0.0" } }, - "is-path-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", - "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", - "dev": true - }, - "is-path-in-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", - "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", - "dev": true, - "requires": { - "is-path-inside": "^1.0.0" - } - }, - "is-path-inside": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", - "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", - "dev": true, - "requires": { - "path-is-inside": "^1.0.1" - } - }, "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", @@ -1518,75 +1200,33 @@ "dev": true }, "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "dev": true, "requires": { - "has": "^1.0.1" + "has-symbols": "^1.0.1" } }, "is-resolvable": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", - "integrity": "sha1-jfV8YeouPFAUCNEA+wE8+NbgzGI=", - "dev": true, - "requires": { - "tryit": "^1.0.1" - } - }, - "is-symbol": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", - "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, - "jasmine": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.5.2.tgz", - "integrity": "sha1-YoPO9whcCVzCXWUelU3wBPfj5CE=", + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", "dev": true, "requires": { - "exit": "^0.1.2", - "glob": "^7.0.6", - "jasmine-core": "~2.5.2" - }, - "dependencies": { - "glob": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.0.tgz", - "integrity": "sha1-Nq3YVtdG0NmeTMJ5e7oa4sZycv0=", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.2", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", - "dev": true, - "requires": { - "brace-expansion": "^1.0.0" - } - } + "has-symbols": "^1.0.1" } }, - "jasmine-core": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.5.2.tgz", - "integrity": "sha1-b2G9eQYeJ/Q+b5NV5Es8bKtv8pc=", + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "jasmine-focused": { @@ -1595,37 +1235,14 @@ "integrity": "sha1-uDx1fIAOaOHW78GjoaE/85/23NI=", "dev": true, "requires": { - "jasmine-node": "jasmine-node@git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", + "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": "jasmine-node@git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", + "from": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", "dev": true, "requires": { "coffee-script": ">=1.0.1", @@ -1636,28 +1253,24 @@ "requirejs": ">=0.27.1", "underscore": ">= 1.3.1", "walkdir": ">= 0.0.1" + }, + "dependencies": { + "mkdirp": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=", + "dev": true + } } }, "jasmine-reporters": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.2.0.tgz", - "integrity": "sha1-6MeRbfPkKDvIgpo/whFA6zIvils=", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.3.2.tgz", + "integrity": "sha512-u/7AT9SkuZsUfFBLLzbErohTGNsEUCKaQbsVYnLFW1gEuL2DzmBL4n8v90uZsqIqlWvWUgian8J6yOt5Fyk/+A==", "dev": true, "requires": { - "jasmine": "^2.4.1", "mkdirp": "^0.5.1", "xmldom": "^0.1.22" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - } } }, "js-tokens": { @@ -1666,6 +1279,22 @@ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, "json-stable-stringify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", @@ -1682,9 +1311,9 @@ "dev": true }, "jsonpointer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.1.0.tgz", + "integrity": "sha512-CXcRvMyTlnR53xMcKnuMzfCA5i/nfblTnnr74CZb6C4vG39eu6w51t7nKmU5MfLfbTgGItliNyjO/ciNPDqClg==", "dev": true }, "jsx-ast-utils": { @@ -1704,23 +1333,15 @@ } }, "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, "requires": { "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", + "parse-json": "^4.0.0", + "pify": "^3.0.0", "strip-bom": "^3.0.0" - }, - "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - } } }, "locate-path": { @@ -1731,16 +1352,14 @@ "requires": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" - }, - "dependencies": { - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - } } }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, "lodash.cond": { "version": "4.5.2", "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", @@ -1754,26 +1373,27 @@ "dev": true }, "minimatch": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "lru-cache": "2", - "sigmund": "~1.0.0" + "brace-expansion": "^1.1.7" } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "mkdirp": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", - "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=", - "dev": true + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } }, "ms": { "version": "2.0.0", @@ -1798,6 +1418,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -1810,21 +1436,28 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, + "object-inspect": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", + "dev": true + }, "object-keys": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", - "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, "object.assign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.0.4.tgz", - "integrity": "sha1-scnMBE7xuf5jYG/BQau7MuFHMMw=", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.0", - "object-keys": "^1.0.10" + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" } }, "once": { @@ -1843,17 +1476,17 @@ "dev": true }, "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "requires": { "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", + "fast-levenshtein": "~2.0.6", "levn": "~0.3.0", "prelude-ls": "~1.1.2", "type-check": "~0.3.2", - "wordwrap": "~1.0.0" + "word-wrap": "~1.2.3" } }, "os-homedir": { @@ -1863,10 +1496,13 @@ "dev": true }, "p-limit": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", - "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=", - "dev": true + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } }, "p-locate": { "version": "2.0.0", @@ -1877,23 +1513,27 @@ "p-limit": "^1.1.0" } }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "dev": true, "requires": { - "error-ex": "^1.2.0" + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" } }, "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true }, "path-is-absolute": { "version": "1.0.1", @@ -1908,15 +1548,15 @@ "dev": true }, "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, "pinkie": { @@ -1935,24 +1575,13 @@ } }, "pkg-conf": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.0.0.tgz", - "integrity": "sha1-BxyHZQQDvM+5xif1h1G/5HwGcnk=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", + "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", "dev": true, "requires": { "find-up": "^2.0.0", - "load-json-file": "^2.0.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - } + "load-json-file": "^4.0.0" } }, "pkg-config": { @@ -1967,12 +1596,12 @@ } }, "pkg-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", - "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", "dev": true, "requires": { - "find-up": "^1.0.0" + "find-up": "^2.1.0" } }, "pkg-up": { @@ -1982,6 +1611,27 @@ "dev": true, "requires": { "find-up": "^1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + } } }, "pluralize": { @@ -1997,9 +1647,9 @@ "dev": true }, "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "progress": { @@ -2009,17 +1659,17 @@ "dev": true }, "readable-stream": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", + "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", - "string_decoder": "~1.0.3", + "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, @@ -2041,17 +1691,6 @@ "dev": true, "requires": { "resolve": "^1.1.6" - }, - "dependencies": { - "resolve": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", - "dev": true, - "requires": { - "path-parse": "^1.0.5" - } - } } }, "require-uncached": { @@ -2065,11 +1704,21 @@ } }, "requirejs": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.2.tgz", - "integrity": "sha1-DqqHDUx9s7Fd0TIua2WwOI/EssY=", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", + "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", "dev": true }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + }, "resolve-from": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", @@ -2087,10 +1736,13 @@ } }, "rimraf": { - "version": "2.2.8", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", - "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=", - "dev": true + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } }, "run-async": { "version": "0.1.0", @@ -2102,9 +1754,9 @@ } }, "run-parallel": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.6.tgz", - "integrity": "sha1-KQA8miFj4B4tLfyQV18sbB1hoDk=", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", "dev": true }, "rx-lite": { @@ -2114,9 +1766,9 @@ "dev": true }, "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "semver": { @@ -2134,47 +1786,6 @@ "glob": "^7.0.0", "interpret": "^1.0.0", "rechoir": "^0.6.2" - }, - "dependencies": { - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } } }, "sigmund": { @@ -2231,14 +1842,6 @@ "get-stdin": "^5.0.1", "minimist": "^1.1.0", "pkg-conf": "^2.0.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } } }, "string-width": { @@ -2250,28 +1853,46 @@ "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", "strip-ansi": "^3.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } } }, - "string_decoder": { + "string.prototype.trimend": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", + "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "string.prototype.trimstart": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz", + "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" } }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -2304,37 +1925,18 @@ "string-width": "^2.0.0" }, "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", - "dev": true - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -2343,32 +1945,15 @@ "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } } }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^3.0.0" } } } @@ -2412,10 +1997,10 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, - "tryit": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", - "integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=", + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", "dev": true }, "type-check": { @@ -2439,6 +2024,23 @@ "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.12.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.0.tgz", + "integrity": "sha512-21rQzss/XPMjolTiIezSu3JAjgagXKROtNrYFEOWK109qY1Uv2tVjPTZ1ci2HgvQDA16gHYSthQIJfB+XId/rQ==", + "dev": true + } + } + }, "uniq": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", @@ -2466,10 +2068,10 @@ "integrity": "sha1-BNoCcKh6d4VAFzzb8KLbSZqNnik=", "dev": true }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, "wrappy": { @@ -2491,29 +2093,18 @@ "dev": true, "requires": { "mkdirp": "^0.5.1" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - } } }, "xmldom": { - "version": "0.1.22", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.22.tgz", - "integrity": "sha1-EN5OXpZJgfA8jMcvrcCNFLbDqiY=", + "version": "0.1.31", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz", + "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==", "dev": true }, "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true } } From 6d86f979f49f2a12b0f2bba8e3b5c838b91cbc19 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 30 Dec 2020 18:51:56 -0600 Subject: [PATCH 183/194] Update temp to fix the tests on Windows --- package-lock.json | 27 +++++---------------------- package.json | 2 +- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 208425bb..486677c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1959,30 +1959,13 @@ } }, "temp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/temp/-/temp-0.5.1.tgz", - "integrity": "sha1-d6sZx5qntZPL5PrCRBdoytmHuN8=", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.9.4.tgz", + "integrity": "sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==", "dev": true, "requires": { - "rimraf": "~2.1.4" - }, - "dependencies": { - "graceful-fs": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", - "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", - "dev": true, - "optional": true - }, - "rimraf": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.1.4.tgz", - "integrity": "sha1-Wm62Lu2gaPUe3lDymz5c0i89m7I=", - "dev": true, - "requires": { - "graceful-fs": "~1" - } - } + "mkdirp": "^0.5.1", + "rimraf": "~2.6.2" } }, "text-table": { diff --git a/package.json b/package.json index acbaa7c6..0313a560 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "devDependencies": { "jasmine-focused": "^1.0.4", "standard": "^10.0.3", - "temp": "~0.5.0", + "temp": "~0.9.4", "underscore": "~1.5.2", "wrench": "~1.4.4" }, From 826031a0cf19b6a06d1ba156a45edf236032f684 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 30 Dec 2020 18:52:09 -0600 Subject: [PATCH 184/194] Run the tests on Windows --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index b0a1d03d..12e44b86 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,6 +15,7 @@ install: - npm run prepare - npm install - npm run lint + - npm run test build: off test: off From ff04ff11c33ecf10985a3d12258ab8b5e6ec14ea Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 30 Dec 2020 18:52:29 -0600 Subject: [PATCH 185/194] Use node 12 in the CI --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index fe0a5e03..9a5e343f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ notifications: on_success: never on_failure: change -node_js: "10" +node_js: "12" git: depth: 10 diff --git a/appveyor.yml b/appveyor.yml index 12e44b86..c5591c2f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,7 @@ clone_depth: 10 skip_tags: true install: - - ps: Install-Product node 6 + - ps: Install-Product node 12 - npm run prepare - npm install - npm run lint From 8bc1ccb7cb4c3903bbc7f07c81075e04b3256b0e Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 30 Dec 2020 18:55:59 -0600 Subject: [PATCH 186/194] Use MSVC 2015 in Appveyor --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index c5591c2f..ed2f43ab 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,7 @@ version: "{build}" +image: Visual Studio 2015 + platform: x64 branches: From 4a22127e129aa1317935f8b7b2636f4829718d6d Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Mon, 11 Jan 2021 22:13:31 -0500 Subject: [PATCH 187/194] .npmignore: Ignore heavy, unused parts of libgit2 (#108) --- .npmignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.npmignore b/.npmignore index 27e4f0ff..338b1395 100644 --- a/.npmignore +++ b/.npmignore @@ -1,6 +1,8 @@ /build /spec /deps/libgit2/build +/deps/libgit2/fuzzers +/deps/libgit2/tests /deps/libgit2/tests-clar *.a *.o From 06842cec39e92edde8e00fa6206437d32e2c74e0 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 12 Jan 2021 14:21:15 -0600 Subject: [PATCH 188/194] Set CRLF on Appveyor --- appveyor.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index ed2f43ab..9ce50fe4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,6 +12,10 @@ clone_depth: 10 skip_tags: true +init: + # Use CRLF to test correct Windows behavior + - git config --global core.autocrlf true + install: - ps: Install-Product node 12 - npm run prepare From 572d3e86e95ec40de140f4e4f6cfbb767de0701e Mon Sep 17 00:00:00 2001 From: sadick254 Date: Thu, 14 Jan 2021 18:31:08 +0300 Subject: [PATCH 189/194] 5.7.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 486677c4..cc070f31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.7.0", + "version": "5.7.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0313a560..96734bf3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.7.0", + "version": "5.7.1", "license": "MIT", "author": { "name": "Kevin Sawicki", From 0bf7dee86187a422b327fe30158cdeb93ecb111a Mon Sep 17 00:00:00 2001 From: darangi Date: Tue, 15 Jun 2021 18:21:08 +0100 Subject: [PATCH 190/194] gh actions --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ .travis.yml | 29 ----------------------------- README.md | 2 +- appveyor.yml | 28 ---------------------------- 4 files changed, 25 insertions(+), 58 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f5855511 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: [push] + +jobs: + Build: + runs-on: ubuntu-latest + env: + CC: clang + CXX: clang++ + npm_config_clang: 1 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 12 + - name: Install + run: | + npm run prepare + npm install + - name: Test + run: | + npm run lint + npm run test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9a5e343f..00000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: node_js - -notifications: - email: - on_success: never - on_failure: change - -node_js: "12" - -git: - depth: 10 - submodules: false - -branches: - only: - - master - -sudo: false - -env: - - CC=clang CXX=clang++ npm_config_clang=1 - -install: - - npm run prepare - - npm install - -script: - - npm run lint - - npm run test diff --git a/README.md b/README.md index 1d5a341f..fb92a0fb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Git Node module [![Build Status](https://travis-ci.org/atom/git-utils.svg?branch=master)](https://travis-ci.org/atom/git-utils) [![Build status](https://ci.appveyor.com/api/projects/status/myrqbxes1mv8b472?svg=true)](https://ci.appveyor.com/project/Atom/git-utils) +# Git Node module [![CI](https://github.com/atom/git-utils/actions/workflows/ci.yml/badge.svg)](https://github.com/atom/git-utils/actions/workflows/ci.yml) Helpers for working with Git repositories built natively on top of diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 9ce50fe4..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: "{build}" - -image: Visual Studio 2015 - -platform: x64 - -branches: - only: - - master - -clone_depth: 10 - -skip_tags: true - -init: - # Use CRLF to test correct Windows behavior - - git config --global core.autocrlf true - -install: - - ps: Install-Product node 12 - - npm run prepare - - npm install - - npm run lint - - npm run test - -build: off -test: off -deploy: off From 4db27685a08d6066844aa8e68172688bd0c19cb4 Mon Sep 17 00:00:00 2001 From: sadick254 Date: Mon, 21 Jun 2021 22:07:20 +0300 Subject: [PATCH 191/194] Bump nan@2.14.2 --- .github/workflows/ci.yml | 2 +- package-lock.json | 6 +++--- package.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5855511..bbf1d1fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 12 + node-version: 14 - name: Install run: | npm run prepare diff --git a/package-lock.json b/package-lock.json index cc070f31..281b482b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1408,9 +1408,9 @@ "dev": true }, "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" }, "natural-compare": { "version": "1.4.0", diff --git a/package.json b/package.json index 96734bf3..2d2a3aec 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,8 @@ "wrench": "~1.4.4" }, "dependencies": { - "nan": "^2.14.0", - "fs-plus": "^3.0.0" + "fs-plus": "^3.0.0", + "nan": "^2.14.2" }, "scripts": { "lint": "standard src spec", From dea9ac5a31349e8685737e34d5b00544c8f8b0bd Mon Sep 17 00:00:00 2001 From: sadick254 Date: Mon, 21 Jun 2021 22:16:34 +0300 Subject: [PATCH 192/194] 5.7.2 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 281b482b..abe81d3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.7.1", + "version": "5.7.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2d2a3aec..d3bd9e92 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.7.1", + "version": "5.7.2", "license": "MIT", "author": { "name": "Kevin Sawicki", From 208a033cccb8a2fd297ac1507fcedd388a88a68b Mon Sep 17 00:00:00 2001 From: sadick254 Date: Thu, 8 Jul 2021 19:46:37 +0300 Subject: [PATCH 193/194] 5.7.3 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index abe81d3c..1cb2463d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-utils", - "version": "5.7.2", + "version": "5.7.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d3bd9e92..2d6a9e1e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-utils", "description": "A package for using Git repositories", - "version": "5.7.2", + "version": "5.7.3", "license": "MIT", "author": { "name": "Kevin Sawicki", From 995561888de43cc39b173a12c56d2d71cd2b667b Mon Sep 17 00:00:00 2001 From: Musa Ibrahim Date: Wed, 28 Sep 2022 11:52:01 +0100 Subject: [PATCH 194/194] add sunset message --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb92a0fb..91a2765d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# Git Node module [![CI](https://github.com/atom/git-utils/actions/workflows/ci.yml/badge.svg)](https://github.com/atom/git-utils/actions/workflows/ci.yml) +##### Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our [official announcement](https://github.blog/2022-06-08-sunsetting-atom/) + # Git Node module [![CI](https://github.com/atom/git-utils/actions/workflows/ci.yml/badge.svg)](https://github.com/atom/git-utils/actions/workflows/ci.yml) Helpers for working with Git repositories built natively on top of