diff --git a/CHANGELOG.md b/CHANGELOG.md index a94ef89c2..ce9f1b425 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,29 +1,38 @@ # Change Log -## [0.11.0](https://github.com/nodegit/nodegit/releases/tag/v0.11.1) (2016-02-09) +## [0.11.2](https://github.com/nodegit/nodegit/releases/tag/v0.11.2) (2016-02-18) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.1...v0.11.2) + +- Fixed an issue where when staging lines if the index is locked NodeGit just nuked it [PR #906](https://github.com/nodegit/nodegit/pull/906) +- Fixed diff calculation when staging lines/hunks [PR #906](https://github.com/nodegit/nodegit/pull/906) +- Fixed seg-fault in linux that happens when getting the diff of very small files [PR #908](https://github.com/nodegit/nodegit/pull/908) +- Fixed `RevWalk#fastWalk` dying when an error happens in libgit2 [PR #909](https://github.com/nodegit/nodegit/pull/909) + +## [0.11.1](https://github.com/nodegit/nodegit/releases/tag/v0.11.1) (2016-02-09) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.0...v0.11.1) -- Numerous fixes and perf boosts to file history -- Several doc fixes +- Numerous fixes and perf boosts to file history [PR #900](https://github.com/nodegit/nodegit/pull/900)[PR #896](https://github.com/nodegit/nodegit/pull/896) +- Several doc fixes [PR #899](https://github.com/nodegit/nodegit/pull/899)[PR #897](https://github.com/nodegit/nodegit/pull/897) ## [0.11.0](https://github.com/nodegit/nodegit/releases/tag/v0.11.0) (2016-02-04) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.10.0...v0.11.0) -- Change `Revert.commit` and `Revert.revert` to by async. [PR #887](https://github.com/nodegit/nodegit/pull/887 -- Added `RevWalk#fileHistoryWalk` for a faster way to retrieve history for a specific file. [PR #889](https://github.com/nodegit/nodegit/pull/889 +- Change `Revert.commit` and `Revert.revert` to by async. [PR #887](https://github.com/nodegit/nodegit/pull/887) +- Added `RevWalk#fileHistoryWalk` for a faster way to retrieve history for a specific file. [PR #889](https://github.com/nodegit/nodegit/pull/889) ## [0.10.0](https://github.com/nodegit/nodegit/releases/tag/v0.10.0) (2016-02-01) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.9.0...v0.10.0) -- Clean mutexes are part of GC. No longer leaves processes running after the script ends [PR #880](https://github.com/nodegit/nodegit/pull/880 -- Increased the performance of `ConvenientPatch` by an order of magnitude [PR #883](https://github.com/nodegit/nodegit/pull/883 +- Clean mutexes are part of GC. No longer leaves processes running after the script ends [PR #880](https://github.com/nodegit/nodegit/pull/880) +- Increased the performance of `ConvenientPatch` by an order of magnitude [PR #883](https://github.com/nodegit/nodegit/pull/883) # API changes - `ConvenientPatch` - - `ConvenientPatch` does not have a `patch` or a `delta` property associated with it, if you were using the `delta`, please just use prototype methods `oldFIle`, `newFile`, and `Status`, which are stripped directly from the `delta`. + - `ConvenientPatch` does not have a `patch` or a `delta` property associated with it, if you were using the `delta`, please just use prototype methods `oldFile`, `newFile`, and `Status`, which are stripped directly from the `delta`. - `ConvenientPatch#hunks` returns a promise with an array of `ConvenientHunks`. - `ConvenientHunk` - `ConvenientHunk` does not have an exposed diffHunk associated with it, but does have the same members as diffHunk: diff --git a/README.md b/README.md index 189cb4dcd..74ff250fd 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ NodeGit -**Stable: 0.11.0** +**Stable: 0.11.2** ## Have a problem? Come chat with us! ## diff --git a/generate/templates/manual/revwalk/fast_walk.cc b/generate/templates/manual/revwalk/fast_walk.cc index 610da5458..4a2ad7ea5 100644 --- a/generate/templates/manual/revwalk/fast_walk.cc +++ b/generate/templates/manual/revwalk/fast_walk.cc @@ -56,7 +56,7 @@ void GitRevwalk::FastWalkWorker::Execute() baton->out = NULL; } else { - baton->error_code == GIT_OK; + baton->error_code = GIT_OK; } break; diff --git a/generate/templates/manual/src/convenient_patch.cc b/generate/templates/manual/src/convenient_patch.cc index ff4d54306..adc324988 100644 --- a/generate/templates/manual/src/convenient_patch.cc +++ b/generate/templates/manual/src/convenient_patch.cc @@ -75,13 +75,17 @@ PatchData *createFromRaw(git_patch *raw) { const git_diff_line *line; git_patch_get_line_in_hunk(&line, raw, i, j); - if ( - j == 0 && - !strcmp( - &line->content[strlen(line->content) - 29], - "\n\\ No newline at end of file\n" - )) { - EOFFlag = true; + if (j == 0) { + // calculate strlen only once for the first line of the first hunk. + int calculatedContentLength = strlen(line->content); + if ( + calculatedContentLength > 29 && + !strcmp( + &line->content[calculatedContentLength - 29], + "\n\\ No newline at end of file\n" + )) { + EOFFlag = true; + } } storeLine->origin = line->origin; diff --git a/lib/repository.js b/lib/repository.js index 121543ebd..1da4e29f5 100644 --- a/lib/repository.js +++ b/lib/repository.js @@ -1361,20 +1361,22 @@ Repository.prototype.stageLines = var repo = this; var index; - var diffPromise = isSelectionStaged ? - repo.getHeadCommit() - .then(function getTreeFromCommit(commit) { - return commit.getTree(); - }) - .then(function getDiffFromTree(tree) { - return NodeGit.Diff.treeToIndex(repo, tree, index); - }) - : - NodeGit.Diff.indexToWorkdir(repo, index, { - flags: - NodeGit.Diff.OPTION.SHOW_UNTRACKED_CONTENT | - NodeGit.Diff.OPTION.RECURSE_UNTRACKED_DIRS - }); + var diffPromise = function diffPromise() { + return isSelectionStaged ? + repo.getHeadCommit() + .then(function getTreeFromCommit(commit) { + return commit.getTree(); + }) + .then(function getDiffFromTree(tree) { + return NodeGit.Diff.treeToIndex(repo, tree, index); + }) + : + NodeGit.Diff.indexToWorkdir(repo, index, { + flags: + NodeGit.Diff.OPTION.SHOW_UNTRACKED_CONTENT | + NodeGit.Diff.OPTION.RECURSE_UNTRACKED_DIRS + }); + }; //The following chain checks if there is a patch with no hunks left for the //file, and no filemode changes were done on the file. It is then safe to @@ -1409,18 +1411,13 @@ Repository.prototype.stageLines = }); }; - var indexLock = repo.path().replace(".git/", "") + ".git/index.lock"; - - return fse.remove(indexLock) - .then(function() { - return repo.openIndex(); - }) + return repo.openIndex() .then(function(indexResult) { index = indexResult; return index.read(1); }) .then(function() { - return diffPromise; + return diffPromise(); }) .then(function(diff) { if (!(NodeGit.Status.file(repo, filePath) & diff --git a/package.json b/package.json index 29fa3b13d..4e64d0c33 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegit", "description": "Node.js libgit2 asynchronous native bindings", - "version": "0.11.1", + "version": "0.11.2", "homepage": "http://nodegit.org", "keywords": [ "libgit2",