Skip to content

Commit

Permalink
merge: upstream/master into master
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeJerred committed Jun 29, 2024
2 parents 9ee0b81 + 0690072 commit adb53fa
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Change Log

## <a name="v0-28-0-alpha.27" href="#v0-28-0-alpha-27">v0.28.0-alpha.27</a> [(2024-06-06)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.27)

[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.26...v0.28.0-alpha.27)

#### Summary of changes
- Build on Electron 29+

#### Merged PRs into NodeGit
- [Fix build failure on electron 29+](https://github.com/nodegit/nodegit/pull/1998)

## <a name="v0-28-0-alpha.26" href="#v0-28-0-alpha-26">v0.28.0-alpha.26</a> [(2024-04-19)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.26)

[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.25...v0.28.0-alpha.26)

#### Summary of changes
- Fix use-after-free in getRemotes

#### Merged PRs into NodeGit
- [Fix double-free introduced trying to fix other double-free](https://github.com/nodegit/nodegit/pull/1996)

## <a name="v0-28-0-alpha.25" href="#v0-28-0-alpha-25">v0.28.0-alpha.25</a> [(2024-04-15)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.25)

[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.24...v0.28.0-alpha.25)

#### Summary of changes
- Fix use-after-free in getReferences

#### Merged PRs into NodeGit
- [Don't free the given repo on error in getReferences and getRemotes](https://github.com/nodegit/nodegit/pull/1995)

## <a name="v0-28-0-alpha.24" href="#v0-28-0-alpha-24">v0.28.0-alpha.24</a> [(2024-02-20)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.24)

[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.23...v0.28.0-alpha.24)
Expand Down
3 changes: 2 additions & 1 deletion generate/templates/manual/repository/get_references.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ void GitRepository::GetReferencesWorker::Execute()
}

git_strarray_free(&reference_names);
git_repository_free(repo);
delete baton->out;
baton->out = NULL;
return;
Expand All @@ -80,6 +79,8 @@ void GitRepository::GetReferencesWorker::Execute()
baton->out->push_back(reference);
}
}

git_strarray_free(&reference_names);
}

void GitRepository::GetReferencesWorker::HandleErrorCallback() {
Expand Down
10 changes: 4 additions & 6 deletions generate/templates/manual/repository/get_remotes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ void GitRepository::GetRemotesWorker::Execute()
{
giterr_clear();

git_repository *repo;
{
nodegit::LockMaster lockMaster(true, baton->repo);
baton->error_code = git_repository_open(&repo, git_repository_workdir(baton->repo));
}
git_repository *repo = baton->repo;

if (baton->error_code != GIT_OK) {
if (giterr_last() != NULL) {
Expand All @@ -51,6 +47,7 @@ void GitRepository::GetRemotesWorker::Execute()
if (giterr_last() != NULL) {
baton->error = git_error_dup(giterr_last());
}

delete baton->out;
baton->out = NULL;
return;
Expand All @@ -74,14 +71,15 @@ void GitRepository::GetRemotesWorker::Execute()
}

git_strarray_free(&remote_names);
git_repository_free(repo);
delete baton->out;
baton->out = NULL;
return;
}

baton->out->push_back(remote);
}

git_strarray_free(&remote_names);
}

void GitRepository::GetRemotesWorker::HandleErrorCallback() {
Expand Down
10 changes: 6 additions & 4 deletions lifecycleScripts/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ module.exports = function install() {
}

return new Promise(function(resolve, reject) {
const gypPath = path.join(__dirname, "..", "node_modules", "node-gyp", "bin", "node-gyp.js");
var spawnedNodePreGyp = spawn(nodePreGyp, args, {
env: Object.assign({}, process.env, {
npm_config_node_gyp: path.join(__dirname, "..", "node_modules",
"node-gyp", "bin", "node-gyp.js")
})
env: {
...process.env,
npm_config_node_gyp: gypPath
},
shell: process.platform === "win32"
});

spawnedNodePreGyp.stdout.on("data", function(data) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"node": ">= 16"
},
"dependencies": {
"@axosoft/nan": "git://github.com/MikeJerred/nan.git",
"@axosoft/nan": "^2.19.0-gk.1",
"@mapbox/node-pre-gyp": "^1.0.11",
"fs-extra": "^10.0.0",
"got": "^11.8.6",
Expand Down

0 comments on commit adb53fa

Please sign in to comment.