Title: Commit.lookupPrefix misses repo property · Issue #2008 · nodegit/nodegit · GitHub
Open Graph Title: Commit.lookupPrefix misses repo property · Issue #2008 · nodegit/nodegit
X Title: Commit.lookupPrefix misses repo property · Issue #2008 · nodegit/nodegit
Description: The following code import Nodegit from "nodegit"; const repo = await Nodegit.Repository.open("/home/user/git/linux"); const c = await Nodegit.Commit.lookupPrefix(repo, Nodegit.Oid.fromString("4387bfa605206b57451e6f77af1287960981ffa2"), 4...
Open Graph Description: The following code import Nodegit from "nodegit"; const repo = await Nodegit.Repository.open("/home/user/git/linux"); const c = await Nodegit.Commit.lookupPrefix(repo, Nodegit.Oid.fromString("4387b...
X Description: The following code import Nodegit from "nodegit"; const repo = await Nodegit.Repository.open("/home/user/git/linux"); const c = await Nodegit.Commit.lookupPrefix(repo, Nodegit.O...
Opengraph URL: https://github.com/nodegit/nodegit/issues/2008
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Commit.lookupPrefix misses repo property","articleBody":"The following code\r\n```\r\nimport Nodegit from \"nodegit\";\r\n\r\nconst repo = await Nodegit.Repository.open(\"/home/user/git/linux\");\r\n\r\nconst c = await Nodegit.Commit.lookupPrefix(repo, Nodegit.Oid.fromString(\"4387bfa605206b57451e6f77af1287960981ffa2\"), 40);\r\nconsole.log(c.sha(), c.getDiff());\r\n```\r\n\r\nleads to an exception: \r\n\r\n```\r\n/home/user/git/analysis/node_modules/nodegit/dist/commit.js:290\r\n return this.repo.getTree(this.treeId());\r\n ^\r\n\r\nTypeError: Cannot read properties of undefined (reading 'getTree')\r\n at Commit.getTree (/home/user/git/analysis/node_modules/nodegit/dist/commit.js:290:20)\r\n at Commit.getDiffWithOptions (/home/user/git/analysis/node_modules/nodegit/dist/commit.js:209:17)\r\n at Commit.getDiff (/home/user/git/analysis/node_modules/nodegit/dist/commit.js:195:15)\r\n at file:///home/user/git/analysis/test.mjs:6:24\r\n```\r\n\r\nThe issue is analog to #1658, and can be fixed the same way.\r\nHowever it might be better to have a generic wrapper for commit objects being returned by the raw api.","author":{"url":"https://github.com/lal12","@type":"Person","name":"lal12"},"datePublished":"2024-10-31T17:01:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2008/nodegit/issues/2008"}
| 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:80faaef2-003d-331c-dc01-508ec60065f2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D9EA:346016:1FCDE07:2B1F90F:69708374 |
| html-safe-nonce | a4a4ae6ad4b9da82e5664d210c959dcc269908711f75019ef71ea8fde50221b3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUVBOjM0NjAxNjoxRkNERTA3OjJCMUY5MEY6Njk3MDgzNzQiLCJ2aXNpdG9yX2lkIjoiMjM2NTQ5NzY1ODU5Mjc1NjU5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 44b7cbf77d2a4f2bac982d5c776140eefbae828d9c398c6593b5b8ce34738480 |
| hovercard-subject-tag | issue:2627375766 |
| 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/2008/issue_layout |
| twitter:image | https://opengraph.githubassets.com/81ea8cca7b1df8a8c3a6be951dd6670fa290b1d5eb79ef9608317c3524f08abc/nodegit/nodegit/issues/2008 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/81ea8cca7b1df8a8c3a6be951dd6670fa290b1d5eb79ef9608317c3524f08abc/nodegit/nodegit/issues/2008 |
| og:image:alt | The following code import Nodegit from "nodegit"; const repo = await Nodegit.Repository.open("/home/user/git/linux"); const c = await Nodegit.Commit.lookupPrefix(repo, Nodegit.Oid.fromString("4387b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lal12 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| 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 | 7d6181066430cc06553c8396ca201e194ae33cb9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width