Title: Diff.merge: inconsistent behavior · Issue #1002 · nodegit/nodegit · GitHub
Open Graph Title: Diff.merge: inconsistent behavior · Issue #1002 · nodegit/nodegit
X Title: Diff.merge: inconsistent behavior · Issue #1002 · nodegit/nodegit
Description: I have two diffs, one from commit.getDiffWithOptions and one from NodeGit.Diff.treeToWorkdirWithIndex where the tree is from the head commit. They were made with the same options. When merging the two diffs, depending on which diff is me...
Open Graph Description: I have two diffs, one from commit.getDiffWithOptions and one from NodeGit.Diff.treeToWorkdirWithIndex where the tree is from the head commit. They were made with the same options. When merging the ...
X Description: I have two diffs, one from commit.getDiffWithOptions and one from NodeGit.Diff.treeToWorkdirWithIndex where the tree is from the head commit. They were made with the same options. When merging the ...
Opengraph URL: https://github.com/nodegit/nodegit/issues/1002
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Diff.merge: inconsistent behavior","articleBody":"I have two diffs, one from `commit.getDiffWithOptions` and one from `NodeGit.Diff.treeToWorkdirWithIndex` where the tree is from the head commit. They were made with the same options. When merging the two diffs, depending on which diff is merged into which, either the diffs will merge or this error will be thrown:\n\n\u003e Error: Attempt to merge diffs created with conflicting options\n\nHere's some kind of pseudo code\n\n``` javascript\nlet workDirWithIndexDiff;\nrepo.getHeadCommit()\n .then(headCommit =\u003e headCommit.getTree())\n .then(headTree =\u003e NodeGit.Diff.treeToWorkdirWithIndex(repo, headTree, {}))\n .then(_workDirWithIndexDiff =\u003e {\n workDirWithIndexDiff = _workDirWithIndexDiff;\n return someCommit.getDiffWithOptions({});\n })\n .then(someDiff =\u003e {\n // This would reject with Error: Attempt to merge diffs created with conflicting options\n someDiff.merge(workDirWithIndexDiff);\n\n // This would resolve\n workDirWithIndexDiff.merge(someDiff);\n });\n```\n","author":{"url":"https://github.com/smith-kyle","@type":"Person","name":"smith-kyle"},"datePublished":"2016-04-23T00:32:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1002/nodegit/issues/1002"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8da9f21c-7247-2f1b-6727-93f371f3c86e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9BAA:3DCA42:92DE4:C5E74:6A5FE596 |
| html-safe-nonce | 335aed41aa690ea5c8f6d8c471e5142e9d4f17c7858c2fd8e87f703e239ee18e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkFBOjNEQ0E0Mjo5MkRFNDpDNUU3NDo2QTVGRTU5NiIsInZpc2l0b3JfaWQiOiIzMzAzMTU4NDU2MDYxNTE5MjU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d7cad16e02fba0449bc6cbf858c8499224914b883a55cc91a45ad694f57e421c |
| hovercard-subject-tag | issue:150500547 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodegit/nodegit/1002/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1289644bac6ca18529dcfb1d75246f965b5c16499e4e9b7b85509fc1e0db2296/nodegit/nodegit/issues/1002 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1289644bac6ca18529dcfb1d75246f965b5c16499e4e9b7b85509fc1e0db2296/nodegit/nodegit/issues/1002 |
| og:image:alt | I have two diffs, one from commit.getDiffWithOptions and one from NodeGit.Diff.treeToWorkdirWithIndex where the tree is from the head commit. They were made with the same options. When merging the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | smith-kyle |
| hostname | github.com |
| expected-hostname | github.com |
| None | 78938542173c0d8e4ad1aefc7954896e81c10ce2620286603ef14cf593bd5a11 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodegit/nodegit git https://github.com/nodegit/nodegit.git |
| octolytics-dimension-user_id | 657068 |
| octolytics-dimension-user_login | nodegit |
| octolytics-dimension-repository_id | 1383170 |
| octolytics-dimension-repository_nwo | nodegit/nodegit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1383170 |
| octolytics-dimension-repository_network_root_nwo | nodegit/nodegit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1a427601e09953033b696253e754ebc7328096a7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width