Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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 7 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 4 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 2 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 12 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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.