Title: Change how getReferenceCommit() retrieves commits by rcjsuen · Pull Request #1420 · nodegit/nodegit · GitHub
Open Graph Title: Change how getReferenceCommit() retrieves commits by rcjsuen · Pull Request #1420 · nodegit/nodegit
X Title: Change how getReferenceCommit() retrieves commits by rcjsuen · Pull Request #1420 · nodegit/nodegit
Description: The current code in repository.js assumes that the return value from reference.target() is an oid that points to a commit. nodegit/lib/repository.js Lines 1057 to 1069 in b6e1478 Repository.prototype.getReferenceCommit = function(name, callback) { var repository = this; return this.getReference(name).then(function(reference) { return repository.getCommit(reference.target()).then(function(commit) { if (typeof callback === "function") { callback(null, commit); } return commit; }); }, callback); }; However, this is not true for annotated commits as its target oid is actually the tag object itself. To get around this, reference.peel(NodeGit.Object.TYPE.COMMIT) should be used instead so that the reference object will fully unwrap itself to the underlying commit object. This should fix #1370.
Open Graph Description: The current code in repository.js assumes that the return value from reference.target() is an oid that points to a commit. nodegit/lib/repository.js Lines 1057 to 1...
X Description: The current code in repository.js assumes that the return value from reference.target() is an oid that points to a commit. nodegit/lib/repository.js Lines 1057 to 1...
Opengraph URL: https://github.com/nodegit/nodegit/pull/1420
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:f9b4d592-c161-3675-ac5f-6ca2412c0772 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | D34E:2F50C0:1FA0A81:2C83E52:6970E9B8 |
| html-safe-nonce | 56781c5d6a3260f875f6a5ef37f27693a75387cc7ce3f7f3cff6b1f821926d0a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzRFOjJGNTBDMDoxRkEwQTgxOjJDODNFNTI6Njk3MEU5QjgiLCJ2aXNpdG9yX2lkIjoiNzA3NTQ0OTY1OTcxNDQ5Njk1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4809ce46d8cacdbe26aee8b620502d551702fa33756e1f73a155f5499ac63499 |
| hovercard-subject-tag | pull_request:160113353 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/nodegit/nodegit/pull/1420/checks |
| twitter:image | https://avatars.githubusercontent.com/u/15629116?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/15629116?s=400&v=4 |
| og:image:alt | The current code in repository.js assumes that the return value from reference.target() is an oid that points to a commit. nodegit/lib/repository.js Lines 1057 to 1... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b6ca3cb96fa07d8a62b95d681f9dc8fffb49a43f4fea2a5bcac6d8f5107cbf4e |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d2448578278810c7bf94faa67651ef5adb1abfde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width