Title: (Bug) Revert.revert requires a RevertOptions parameter · Issue #1403 · nodegit/nodegit · GitHub
Open Graph Title: (Bug) Revert.revert requires a RevertOptions parameter · Issue #1403 · nodegit/nodegit
X Title: (Bug) Revert.revert requires a RevertOptions parameter · Issue #1403 · nodegit/nodegit
Description: Revert.revert requires a Revert Options parameter or a null to be passed into the method unlike other methods such as Merge.merge nodegit/lib/merge.js Lines 28 to 39 in 6ff67a8 /** * Merge a commit into HEAD and writes the results to the...
Open Graph Description: Revert.revert requires a Revert Options parameter or a null to be passed into the method unlike other methods such as Merge.merge nodegit/lib/merge.js Lines 28 to 39 in 6ff67a8 /** * Merge a commit...
X Description: Revert.revert requires a Revert Options parameter or a null to be passed into the method unlike other methods such as Merge.merge nodegit/lib/merge.js Lines 28 to 39 in 6ff67a8 /** * Merge a commit...
Opengraph URL: https://github.com/nodegit/nodegit/issues/1403
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"(Bug) Revert.revert requires a RevertOptions parameter","articleBody":"Revert.revert requires a Revert Options parameter or a null to be passed into the method unlike other methods such as Merge.merge https://github.com/nodegit/nodegit/blob/6ff67a883c66a1cee23feb53b5f82c36c8a4df04/lib/merge.js#L28-L39\r\nand Revert.commit https://github.com/nodegit/nodegit/blob/6ff67a883c66a1cee23feb53b5f82c36c8a4df04/lib/revert.js#L16-L29. \r\n\r\nWhen a RevertOptions parameter is not passed into Revert.revert this error is thrown\r\n`(node:46081) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Callback is required and must be a Function.` when talking with @rcjsuen in slack he noticed that the error was misleading and originated from the c++ layer.\r\n\r\nHere is the code that threw this error\r\n```\r\n/**\r\n * @description reverts the git branch to the requested commit\r\n * @param {String} hash represents the hash of the commit\r\n * @async\r\n */\r\nasync function revert(hash) {\r\n\treturn new Promise(async function handlePromise(resolve, reject) {\r\n\t\ttry {\r\n\t\t\tlet repo = await openRepository(sitePath);\r\n\r\n\t\t\tlogger.info('Setting new head...');\r\n\t\t\tlet newHead = await repo.getCommit(hash);\r\n\r\n\t\t\tlogger.info('Reverting...');\r\n\t\t\tawait Git.Revert.revert(\r\n\t\t\t\trepo,\r\n\t\t\t\tnewHead,\r\n\t\t\t);\r\n\t\t\treturn resolve();\r\n\t\t} catch(err) {\r\n\t\t\tlogger.error(`${err}`);\r\n\t\t\treturn reject(err);\r\n\t\t}\r\n\t});\r\n}\r\n```","author":{"url":"https://github.com/ecoulson","@type":"Person","name":"ecoulson"},"datePublished":"2017-11-26T10:18:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/1403/nodegit/issues/1403"}
| 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:5a1b13e1-bf3c-5e48-30e3-9315bac4fbca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A9DA:4F94A:74028F:9FA361:6A6041F1 |
| html-safe-nonce | aa699196f02896e8bb2b098feb6c1575d232aab6bcca5c5990b7dac68934e72a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOURBOjRGOTRBOjc0MDI4Rjo5RkEzNjE6NkE2MDQxRjEiLCJ2aXNpdG9yX2lkIjoiMzc2NjY5NjcxNDE5NzU0OTU1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c33db04194438e4045faa980f6c017c66b5c47443785025ff6ac12e6dba9c72c |
| hovercard-subject-tag | issue:276813924 |
| 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/1403/issue_layout |
| twitter:image | https://opengraph.githubassets.com/69859533b368394c729f93a02708119eb7b4b138b028a1303091ee6bff0ed6dd/nodegit/nodegit/issues/1403 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/69859533b368394c729f93a02708119eb7b4b138b028a1303091ee6bff0ed6dd/nodegit/nodegit/issues/1403 |
| og:image:alt | Revert.revert requires a Revert Options parameter or a null to be passed into the method unlike other methods such as Merge.merge nodegit/lib/merge.js Lines 28 to 39 in 6ff67a8 /** * Merge a commit... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ecoulson |
| 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