Title: Repository.createCommitOnHead ignores `filesToAdd` argument · Issue #655 · nodegit/nodegit · GitHub
Open Graph Title: Repository.createCommitOnHead ignores `filesToAdd` argument · Issue #655 · nodegit/nodegit
X Title: Repository.createCommitOnHead ignores `filesToAdd` argument · Issue #655 · nodegit/nodegit
Description: hi, it looks like Repository.createCommitOnHead ignores the first argument filesToAdd. it is not using it at all, and instead adds all the files! and that is why this function to create empty commits doesn't work as expected when there a...
Open Graph Description: hi, it looks like Repository.createCommitOnHead ignores the first argument filesToAdd. it is not using it at all, and instead adds all the files! and that is why this function to create empty commi...
X Description: hi, it looks like Repository.createCommitOnHead ignores the first argument filesToAdd. it is not using it at all, and instead adds all the files! and that is why this function to create empty commi...
Opengraph URL: https://github.com/nodegit/nodegit/issues/655
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Repository.createCommitOnHead ignores `filesToAdd` argument","articleBody":"hi,\n\nit looks like `Repository.createCommitOnHead` ignores the first argument `filesToAdd`. it is not using it at all, and instead [adds all the files!](https://github.com/nodegit/nodegit/blob/master/lib/repository.js#L496)\n\nand that is why this function to create empty commits doesn't work as expected when there are (unstaged) files with changes:\n\n``` javascript\nfunction createEmptyCommit(repo, message, sig) {\n var files = []; // \u003c--\n sig = sig || createSignature();\n var author = sig;\n var committer = sig;\n\n return unstageAll(repo) // make sure commit is in fact empty. (does a mixed reset)\n .then(function() {\n return repo.createCommitOnHead(\n files,\n author,\n committer,\n message\n );\n })\n .catch(function(err) {\n handleError(err);\n });\n}\n```\n","author":{"url":"https://github.com/freder","@type":"Person","name":"freder"},"datePublished":"2015-07-29T09:47:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/655/nodegit/issues/655"}
| 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:7fad500f-2a08-7b7b-163b-44952f5016dd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BEF8:1FAD2A:1EC0E6:282314:6A5BECF8 |
| html-safe-nonce | f6392e4b37782a9388a817b2b0babd9dd4faef86760fb5faced17394ef4158d5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUY4OjFGQUQyQToxRUMwRTY6MjgyMzE0OjZBNUJFQ0Y4IiwidmlzaXRvcl9pZCI6IjIyMDg3NzA3NzE1MTQwMjcyNTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a74dc74da51874a4d17e4e7db3e3dbb30b6d36968b7f8ff22d3d46920d13c7a4 |
| hovercard-subject-tag | issue:97899083 |
| 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/655/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6a58c21f35c1fb8477ab9abe8fbc7f8744786703cadfa954dc8ff36b901a2072/nodegit/nodegit/issues/655 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6a58c21f35c1fb8477ab9abe8fbc7f8744786703cadfa954dc8ff36b901a2072/nodegit/nodegit/issues/655 |
| og:image:alt | hi, it looks like Repository.createCommitOnHead ignores the first argument filesToAdd. it is not using it at all, and instead adds all the files! and that is why this function to create empty commi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | freder |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width