Title: Index randomly has conflict · Issue #816 · nodegit/nodegit · GitHub
Open Graph Title: Index randomly has conflict · Issue #816 · nodegit/nodegit
X Title: Index randomly has conflict · Issue #816 · nodegit/nodegit
Description: The following code simply creates a blank index, adds 1 file to it, and checks the index for conflict. When running multiple times, once after another, the index will randomly have a conflict, and the conflicted entry will be the only en...
Open Graph Description: The following code simply creates a blank index, adds 1 file to it, and checks the index for conflict. When running multiple times, once after another, the index will randomly have a conflict, and ...
X Description: The following code simply creates a blank index, adds 1 file to it, and checks the index for conflict. When running multiple times, once after another, the index will randomly have a conflict, and ...
Opengraph URL: https://github.com/nodegit/nodegit/issues/816
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Index randomly has conflict","articleBody":"The following code simply creates a blank index, adds 1 file to it, and checks the index for conflict. When running multiple times, once after another, the index will randomly have a conflict, and the conflicted entry will be the only entry, with a `stage` value of 3.\n\nI would expect there never to be a conflict. Is this a bug or have I misunderstood a concept?\n\n``` javascript\nreturn Git.Repository.init(this.repoPath, 0)\n.then(repo =\u003e {\n\n return Git.Index.open('randomindexpath')\n .then(index =\u003e {\n\n //create file entry\n var fileContent = new Buffer(\"first file content\");\n var newFileOid = Git.Blob.createFromBuffer(repo, fileContent, fileContent.length);\n var fileEntry = new Git.IndexEntry();\n fileEntry.path = 'firstfile.txt';\n fileEntry.id = newFileOid;\n fileEntry.mode = Git.TreeEntry.FILEMODE.BLOB;\n //add entry to index\n index.add(fileEntry);\n if (index.hasConflicts()) {\n throw new Error('Index is conflicted');\n }\n });\n});\n```\n","author":{"url":"https://github.com/petemill","@type":"Person","name":"petemill"},"datePublished":"2015-12-09T03:59:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/816/nodegit/issues/816"}
| 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:75e94e35-8c41-5655-c25e-f556f9ac8ba4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B4A0:3EDED5:D74D61:12034A5:6A60567F |
| html-safe-nonce | c0adf1f72f8eb4d06818763e06f8fac5b8188e8d7392b4a0b655921304b78d97 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNEEwOjNFREVENTpENzRENjE6MTIwMzRBNTo2QTYwNTY3RiIsInZpc2l0b3JfaWQiOiI3MzcyNDA2NzM1MTE3NTA2MTc1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9eb21525b3b692a0a51ee9ec4b534cd2497fe5acf1e871ad44cf066e4909e065 |
| hovercard-subject-tag | issue:121154554 |
| 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/816/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eb5f481740874f669d5a842bd14ef2c2ee520ce2b6b3fea3e8cfebfeeff22cd1/nodegit/nodegit/issues/816 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eb5f481740874f669d5a842bd14ef2c2ee520ce2b6b3fea3e8cfebfeeff22cd1/nodegit/nodegit/issues/816 |
| og:image:alt | The following code simply creates a blank index, adds 1 file to it, and checks the index for conflict. When running multiple times, once after another, the index will randomly have a conflict, and ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | petemill |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60da8c2a42fa2bbf5f7567474990ec467836a84444262a58e200fa91b7f3d2d0 |
| 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 | 9824515e740d83d5eb82168a089b806ab0fe04a1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width