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
52 changes: 50 additions & 2 deletions generate/input/descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"selfFreeing": true,
"functions": {
"git_blob_create_frombuffer": {
"isAsync": false,
"isAsync": true,
"args": {
"id": {
"isReturn": true
Expand All @@ -141,11 +141,59 @@
}
}
},
"git_blob_create_fromworkdir": {
"isAsync": true,
"args": {
"id": {
"isReturn": true
}
},
"return": {
"isErrorCode": true
}
},
"git_blob_create_fromdisk": {
"isAsync": true,
"args": {
"id": {
"isReturn": true
}
},
"return": {
"isErrorCode": true
}
},
"git_blob_create_fromchunks": {
"ignore": true
},
"git_blob_filtered_content": {
"ignore": true
"isAsync": true,
"isPrototypeMethod": false,
"args": {
"out": {
"isReturn": true,
"cppClassName": "GitBuf",
"jsClassName": "Buffer"
},
"blob": {
"cppClassName": "GitBlob",
"jsClassName": "Blob",
"isSelf": false
},
"as_path": {
"cppClassName": "String",
"jsClassName": "String",
"cType": "const char *"
},
"check_for_binary_data": {
"cppClassName": "Number",
"jsClassName": "Number",
"cType": "int"
}
},
"return": {
"isErrorCode": true
}
},
"git_blob_id": {
"return": {
Expand Down
8 changes: 4 additions & 4 deletions lib/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ Repository.prototype.createBranch = function(name, commit, force) {
* @param {Buffer} buffer
* @return {Oid}
*/
Repository.prototype.createBlobFromBuffer = function(buffer, callback) {
return Blob.createFromBuffer(this, buffer, buffer.length, callback);
Repository.prototype.createBlobFromBuffer = function(buffer) {
return Blob.createFromBuffer(this, buffer, buffer.length);
};

/**
Expand Down Expand Up @@ -1784,9 +1784,9 @@ Repository.prototype.stageLines =
.then(function(newContent) {
var newContentBuffer = new Buffer(newContent);

var newOid = repo.createBlobFromBuffer(newContentBuffer);
return repo.getBlob(newOid);
return repo.createBlobFromBuffer(newContentBuffer);
})
.then(newOid => repo.getBlob(newOid))
.then(function(newBlob) {
var entry = index.getByPath(filePath, 0);
entry.id = newBlob.id();
Expand Down
Loading