Skip to content

Write the index to a repository directly in merge-cleanly.js examples#1205

Merged
maxkorp merged 1 commit into
nodegit:masterfrom
rcjsuen:merge-cleanly
Jan 30, 2017
Merged

Write the index to a repository directly in merge-cleanly.js examples#1205
maxkorp merged 1 commit into
nodegit:masterfrom
rcjsuen:merge-cleanly

Conversation

@rcjsuen
Copy link
Copy Markdown
Member

@rcjsuen rcjsuen commented Jan 29, 2017

This fixes #1128. The returned index is only in-memory and doesn't know where to write the .git/index file to so we should just skip the write() call and to just only use writeTreeTo() instead.

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.
@maxkorp
Copy link
Copy Markdown
Collaborator

maxkorp commented Jan 30, 2017

Excellent find.

@maxkorp maxkorp merged commit e359ca5 into nodegit:master Jan 30, 2017
@rcjsuen rcjsuen deleted the merge-cleanly branch January 30, 2017 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Writing index after merge throws error

2 participants