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

Provide target repository to write the index to · nodegit/nodegit@9f5a9ca · GitHub

Repository navigation

Commit 9f5a9ca

Browse files
committed
Provide target repository to write the index to
The returned Index from Merge.commits() doesn't know where to write the index to because it is not backed by a repository. This prevents the example from running because the write() fails as it's only in-memory and has no notion of a target .git/index file. Skip the write() and just use writeTreeTo() immediately instead to write the index to the sample repository.
1 parent 0cff089 commit 9f5a9ca

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎examples/merge-cleanly.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,7 @@ fse.remove(path.resolve(__dirname, repoDir))
116116
// the repository instead of just writing it.
117117
.then(function(index) {
118118
if (!index.hasConflicts()) {
119-
return index.write()
120-
.then(function() {
121-
return index.writeTreeTo(repository);
122-
});
119+
return index.writeTreeTo(repository);
123120
}
124121
})
125122

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL