diff --git a/CHANGELOG.md b/CHANGELOG.md index 90fce282f..f84cf9ecb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## [0.11.4](https://github.com/nodegit/nodegit/releases/tag/v0.11.4) (2016-02-24) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.3...v0.11.4) + +- Fixed callback out values in callbacks from C++. This affects any NodeGit call that is passed a callback as an option [PR #921](https://github.com/nodegit/nodegit/pull/921) +- Fixed an issue with building the debug version of NodeGit on windows [PR #918](https://github.com/nodegit/nodegit/pull/918) + ## [0.11.3](https://github.com/nodegit/nodegit/releases/tag/v0.11.3) (2016-02-22) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.2...v0.11.3) diff --git a/README.md b/README.md index 1d5fe6765..ed8126910 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ NodeGit -**Stable: 0.11.3** +**Stable: 0.11.4** ## Have a problem? Come chat with us! ## diff --git a/generate/templates/partials/callback_helpers.cc b/generate/templates/partials/callback_helpers.cc index 869919d2e..0acd215ae 100644 --- a/generate/templates/partials/callback_helpers.cc +++ b/generate/templates/partials/callback_helpers.cc @@ -27,12 +27,6 @@ } } - {% each cbFunction|returnsInfo false true as _return %} - {% if _return.isOutParam %} - *{{ _return.name }} = *baton->{{ _return.name }}; - {% endif %} - {% endeach %} - return baton->result; } @@ -92,7 +86,7 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(uv_as {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); wrapper->selfFreeing = false; - baton->{{ _return.name }} = wrapper->GetRefValue(); + *baton->{{ _return.name }} = wrapper->GetValue(); baton->result = {{ cbFunction.return.success }}; {% else %} if (result->IsNumber()) { @@ -126,7 +120,7 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_promiseComp {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); wrapper->selfFreeing = false; - baton->{{ _return.name }} = wrapper->GetRefValue(); + *baton->{{ _return.name }} = wrapper->GetValue(); baton->result = {{ cbFunction.return.success }}; {% else %} if (result->IsNumber()) { diff --git a/generate/templates/partials/field_accessors.cc b/generate/templates/partials/field_accessors.cc index 05ced5c77..17b338dc3 100644 --- a/generate/templates/partials/field_accessors.cc +++ b/generate/templates/partials/field_accessors.cc @@ -100,7 +100,7 @@ uv_async_init(uv_default_loop(), &baton->req, (uv_async_cb) {{ field.name }}_async); { LockMaster::TemporaryUnlock temporaryUnlock; - + uv_async_send(&baton->req); while(!baton->done) { @@ -108,12 +108,6 @@ } } - {% each field|returnsInfo false true as _return %} - {% if _return.isOutParam %} - *{{ _return.name }} = *baton->{{ _return.name }}; - {% endif %} - {% endeach %} - return baton->result; } @@ -186,7 +180,7 @@ {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); wrapper->selfFreeing = false; - baton->{{ _return.name }} = wrapper->GetRefValue(); + *baton->{{ _return.name }} = wrapper->GetValue(); baton->result = {{ field.return.success }}; {% else %} if (result->IsNumber()) { @@ -219,7 +213,7 @@ {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); wrapper->selfFreeing = false; - baton->{{ _return.name }} = wrapper->GetRefValue(); + *baton->{{ _return.name }} = wrapper->GetValue(); baton->result = {{ field.return.success }}; {% else %} if (result->IsNumber()) { diff --git a/generate/templates/templates/nodegit.cc b/generate/templates/templates/nodegit.cc index 9c1eef135..a1bf7bf30 100644 --- a/generate/templates/templates/nodegit.cc +++ b/generate/templates/templates/nodegit.cc @@ -1,7 +1,7 @@ // This is a generated file, modify: generate/templates/nodegit.cc. +#include #include -#include #include #include #include diff --git a/lib/repository.js b/lib/repository.js index 1da4e29f5..61d221729 100644 --- a/lib/repository.js +++ b/lib/repository.js @@ -131,6 +131,7 @@ Repository.prototype.getBranchCommit = function(name, callback) { /** * Gets the branch that HEAD currently points to * Is an alias to head() + * * @async * @return {Reference} */ @@ -502,6 +503,7 @@ Repository.prototype.createCommit = function( /** * Creates a new commit on HEAD from the list of passed in files + * * @async * @param {Array} filesToAdd * @param {Signature} author @@ -586,6 +588,7 @@ Repository.prototype.defaultSignature = function() { /** * Lists out the remotes in the given repository. * +* @async * @param {Function} Optional callback * @return {Object} Promise object. */ @@ -602,6 +605,7 @@ Repository.prototype.getRemotes = function(callback) { /** * Gets a remote from the repo * + * @async * @param {String|Remote} remote * @param {Function} callback * @return {Remote} The remote object @@ -629,6 +633,7 @@ Repository.prototype.getRemote = function(remote, callback) { /** * Fetches from a remote * + * @async * @param {String|Remote} remote * @param {Object|FetchOptions} fetchOptions Options for the fetch, includes * callbacks for fetching @@ -663,6 +668,8 @@ Repository.prototype.fetch = function( /** * Fetches from all remotes. This is done in series due to deadlocking issues * with fetching from many remotes that can happen. + * + * @async * @param {Object|FetchOptions} fetchOptions Options for the fetch, includes * callbacks for fetching * @param {Function} callback @@ -728,6 +735,7 @@ Repository.prototype.fetchAll = function( /** * Merge a branch onto another branch * + * @async * @param {String|Reference} to * @param {String|Reference} from * @param {Signature} signature @@ -928,6 +936,7 @@ function performRebase(repository, rebase, signature, beforeNextFn) { /** * Rebases a branch onto another branch * + * @async * @param {String} branch * @param {String} upstream * @param {String} onto @@ -1006,6 +1015,7 @@ Repository.prototype.rebaseBranches = function( /** * Continues an existing rebase * + * @async * @param {Signature} signature Identity of the one performing the rebase * @param {Function} beforeNextFn Callback to be called before each step * of the rebase. If the callback returns a @@ -1176,6 +1186,7 @@ Repository.prototype.fetchheadForeach = function(callback) { /** * Stages or unstages line selection of a specified file + * * @async * @param {String|Array} filePath The relative path of this file in the repo * @param {Boolean} stageNew Set to stage new filemode. Unset to unstage. @@ -1250,6 +1261,7 @@ Repository.prototype.stageFilemode = function(filePath, stageNew) { /** * Stages or unstages line selection of a specified file + * * @async * @param {String} filePath The relative path of this file in the repo * @param {Array} newLines The array of DiffLine objects diff --git a/lifecycleScripts/install.js b/lifecycleScripts/install.js index 4b553b4d2..34989f2ac 100644 --- a/lifecycleScripts/install.js +++ b/lifecycleScripts/install.js @@ -79,7 +79,7 @@ function build() { }; var builder = "node-gyp"; - var debug = (process.env.BUILD_DEBUG ? " --debug" : ""); + var debug = (process.env.BUILD_DEBUG ? "--debug" : ""); var target = ""; var distUrl = ""; var runtime = ""; @@ -101,7 +101,7 @@ function build() { else if (nwjsVersion) { builder = "nw-gyp"; target = "--target=" + nwjsVersion; - runtime = "--runtime=node-webkit" + runtime = "--runtime=node-webkit"; } var home = process.platform == "win32" ? diff --git a/package.json b/package.json index 2f4cae9ba..c7bab17cb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegit", "description": "Node.js libgit2 asynchronous native bindings", - "version": "0.11.3", + "version": "0.11.4", "homepage": "http://nodegit.org", "keywords": [ "libgit2",