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

Fixed test and made repo blob method return a promise

parent a48779bc
...@@ -511,8 +511,8 @@ Repository.prototype.createBranch = function(name, commit, force) { ...@@ -511,8 +511,8 @@ Repository.prototype.createBranch = function(name, commit, force) {
* @param {Buffer} buffer * @param {Buffer} buffer
* @return {Oid} * @return {Oid}
*/ */
Repository.prototype.createBlobFromBuffer = function(buffer, callback) { Repository.prototype.createBlobFromBuffer = function(buffer) {
return Blob.createFromBuffer(this, buffer, buffer.length, callback); return Blob.createFromBuffer(this, buffer, buffer.length);
}; };
/** /**
...@@ -1784,9 +1784,9 @@ Repository.prototype.stageLines = ...@@ -1784,9 +1784,9 @@ Repository.prototype.stageLines =
.then(function(newContent) { .then(function(newContent) {
var newContentBuffer = new Buffer(newContent); var newContentBuffer = new Buffer(newContent);
var newOid = repo.createBlobFromBuffer(newContentBuffer); return repo.createBlobFromBuffer(newContentBuffer);
return repo.getBlob(newOid);
}) })
.then(newOid => repo.getBlob(newOid))
.then(function(newBlob) { .then(function(newBlob) {
var entry = index.getByPath(filePath, 0); var entry = index.getByPath(filePath, 0);
entry.id = newBlob.id(); entry.id = newBlob.id();
......
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