Skip to content
Merged
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
20 changes: 10 additions & 10 deletions lib/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,14 +484,14 @@ Repository.prototype.createCommitOnHead = function(
message,
callback){
var repo = this;
var index;

return repo.openIndex().then(function(index) {
index.read(true);

filesToAdd.forEach(function(filePath) {
index.addByPath(filePath);
});

return repo.openIndex().then(function(index_) {
index = index_;
index.read(1);
return index.addAll();
})
.then(function() {
index.write();

return index.writeTree();
Expand Down Expand Up @@ -643,8 +643,8 @@ Repository.prototype.fetchAll = function(
/**
* Merge a branch onto another branch
*
* @param {String|Ref} from
* @param {String|Ref} to
* @param {String|Ref} from
* @return {Oid|Index} A commit id for a succesful merge or an index for a
* merge with conflicts
*/
Expand Down Expand Up @@ -807,8 +807,8 @@ Repository.prototype.checkoutBranch = function(branch, opts) {

var name = ref.name();

return repo.setHead(name,
repo.defaultSignature(),
return repo.setHead(name,
repo.defaultSignature(),
"Switch HEAD to " + name);
})
.then(function() {
Expand Down