Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
maxkorp merged 1 commit intonodegit:masternodegit/nodegit:masterfrom
rcjsuen:merge-cleanlyrcjsuen/nodegit:merge-cleanlyCopy head branch name to clipboard
Jan 30, 2017
Merged

Write the index to a repository directly in merge-cleanly.js examples#1205
maxkorp merged 1 commit intonodegit:masternodegit/nodegit:masterfrom
rcjsuen:merge-cleanlyrcjsuen/nodegit:merge-cleanlyCopy head branch name to clipboard

Conversation

@rcjsuen
Copy link
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
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.