Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion generate/input/descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@
"blob": {
"functions": {
"git_blob_create_frombuffer": {
"isAsync": false,
"args": {
"id": {
"isReturn": true
},
"buffer": {
"cppClassName": "Buffer",
"jsClassName": "Buffer"
Expand Down Expand Up @@ -846,7 +850,8 @@
]
},
"index_entry": {
"ignore": false
"hasConstructor": true,
"ignoreInit": true
},
"indexer": {
"cType": "git_indexer",
Expand Down
4 changes: 4 additions & 0 deletions generate/templates/templates/struct_content.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ using namespace std;

// generated from struct_content.cc
{{ cppClassName }}::{{ cppClassName }}() {
{% if ignoreInit == true %}
{{ cType }}* wrappedValue = new {{ cType }};
{% else %}
{{ cType }} wrappedValue = {{ cType|upper }}_INIT;
{% endif %}
this->raw = ({{ cType }}*) malloc(sizeof({{ cType }}));
memcpy(this->raw, &wrappedValue, sizeof({{ cType }}));

Expand Down
2 changes: 1 addition & 1 deletion lib/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ Repository.prototype.createCommitOnHead = function(
* @return {Blob}
*/
Repository.prototype.createBlobFromBuffer = function(buffer, callback) {
return Blob.createFrombuffer.call(this, buffer, buffer.length, callback);
return Blob.createFromBuffer(this, buffer, buffer.length, callback);
};

/**
Expand Down
12 changes: 6 additions & 6 deletions test/tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe("Index", function() {
it("can get the index of a repo and examine entries", function() {
var entries = this.index.entries();

assert.equal(entries[0].path(), ".gitignore");
assert.equal(entries[0].path, ".gitignore");
});

it("can add all entries to the index", function() {
Expand All @@ -56,7 +56,7 @@ describe("Index", function() {
})
.then(function() {
var newFiles = index.entries().filter(function(entry) {
return ~fileNames.indexOf(entry.path());
return ~fileNames.indexOf(entry.path);
});

assert.equal(newFiles.length, 2);
Expand Down Expand Up @@ -91,7 +91,7 @@ describe("Index", function() {
})
.then(function() {
var newFiles = index.entries().filter(function(entry) {
return ~fileNames.indexOf(entry.path());
return ~fileNames.indexOf(entry.path);
});

assert.equal(newFiles.length, 3);
Expand All @@ -100,7 +100,7 @@ describe("Index", function() {
})
.then(function() {
var newFiles = index.entries().filter(function(entry) {
return ~fileNames.indexOf(entry.path());
return ~fileNames.indexOf(entry.path);
});

assert.equal(newFiles.length, 1);
Expand Down Expand Up @@ -134,7 +134,7 @@ describe("Index", function() {
})
.then(function() {
var newFiles = index.entries().filter(function(entry) {
return ~fileNames.indexOf(entry.path());
return ~fileNames.indexOf(entry.path);
});

assert.equal(newFiles.length, 2);
Expand All @@ -146,7 +146,7 @@ describe("Index", function() {
})
.then(function() {
var newFiles = index.entries().filter(function(entry) {
return ~fileNames.indexOf(entry.path());
return ~fileNames.indexOf(entry.path);
});

assert.equal(newFiles.length, 1);
Expand Down