I am doing some analysis of a codebase over time using nodegit, I am getting commits from an outside source that may no longer exist.
Doing Commit.lookup says it should be safe, but if I do a lookup with an invalid commit (but a full sha), I get the following error:
good repo
[Error: Object not found - failed to find pack entry (b5e13cc50f98d9a045bebadffacf396b9ee49ad5)]
node(16924,0x7fff73d77300) malloc: *** error for object 0x100d02be0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Here is some example code that causes the failure:
var nodegit = require("nodegit")
var Repo = nodegit.Repository
var Commit = nodegit.Commit
Repo.open("/path/to/myrepo").then(function(repo) {
console.log("good repo")
// missing, but valid full length, sha
return Commit.lookup(repo, "b5e13cc50f98d9a045bebadffacf396b9ee49ad5").then(function(commit) {
console.log(commit.message())
}, function(err) { console.log(err); throw err})
}, function(err) { console.log(err); throw err })
I am doing some analysis of a codebase over time using nodegit, I am getting commits from an outside source that may no longer exist.
Doing
Commit.lookupsays it should be safe, but if I do a lookup with an invalid commit (but a full sha), I get the following error:Here is some example code that causes the failure: