Commit a48779bc authored by Carson Howard's avatar Carson Howard Committed by Carson Howard

Added blob methods and converted to async

parent 427f9872
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
"selfFreeing": true, "selfFreeing": true,
"functions": { "functions": {
"git_blob_create_frombuffer": { "git_blob_create_frombuffer": {
"isAsync": false, "isAsync": true,
"args": { "args": {
"id": { "id": {
"isReturn": true "isReturn": true
...@@ -141,11 +141,59 @@ ...@@ -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": { "git_blob_create_fromchunks": {
"ignore": true "ignore": true
}, },
"git_blob_filtered_content": { "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": { "git_blob_id": {
"return": { "return": {
......
This diff is collapsed.
...@@ -247,10 +247,13 @@ describe("Diff", function() { ...@@ -247,10 +247,13 @@ describe("Diff", function() {
function(done) { function(done) {
var evilString = "Unicode’s fun!\nAnd it’s good for you!\n"; var evilString = "Unicode’s fun!\nAnd it’s good for you!\n";
var buffer = new Buffer(evilString); var buffer = new Buffer(evilString);
var oid = Blob.createFromBuffer(this.repository, buffer, buffer.length); var test = this;
Blob.lookup(this.repository, oid) Blob.createFromBuffer(test.repository, buffer, buffer.length)
.then(function(oid) {
return Blob.lookup(test.repository, oid);
})
.then(function(blob) { .then(function(blob) {
blob.repo = this.repository; blob.repo = test.repository;
return Diff.blobToBuffer( return Diff.blobToBuffer(
blob, blob,
null, null,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment