FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix `createCommitOnHead` by johnhaley81 · Pull Request #473 · nodegit/nodegit · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .js  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
20 changes: 10 additions & 10 deletions lib/repository.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL