René's URL Explorer Experiment


Title: `getTree` fails on result of `commit.parent(0)` · Issue #1653 · nodegit/nodegit · GitHub

Open Graph Title: `getTree` fails on result of `commit.parent(0)` · Issue #1653 · nodegit/nodegit

X Title: `getTree` fails on result of `commit.parent(0)` · Issue #1653 · nodegit/nodegit

Description: System information node version: v8.12.0 yarn version: 1.5.1 OS/version/architecture: darwin/18.2.0/x64 Applicable nodegit version: nodegit@0.25.0-alpha.9 (also repros in 0.24.1 and 0.23.0) Repro Here's a repro that runs against the node...

Open Graph Description: System information node version: v8.12.0 yarn version: 1.5.1 OS/version/architecture: darwin/18.2.0/x64 Applicable nodegit version: nodegit@0.25.0-alpha.9 (also repros in 0.24.1 and 0.23.0) Repro H...

X Description: System information node version: v8.12.0 yarn version: 1.5.1 OS/version/architecture: darwin/18.2.0/x64 Applicable nodegit version: nodegit@0.25.0-alpha.9 (also repros in 0.24.1 and 0.23.0) Repro H...

Opengraph URL: https://github.com/nodegit/nodegit/issues/1653

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`getTree` fails on result of `commit.parent(0)`","articleBody":"## System information\r\n  - node version: v8.12.0\r\n  - yarn version: 1.5.1\r\n  - OS/version/architecture: darwin/18.2.0/x64\r\n  - Applicable nodegit version: nodegit@0.25.0-alpha.9 (also repros in 0.24.1 and 0.23.0)\r\n\r\n## Repro\r\n\r\nHere's a repro that runs against the `nodegit` git repo:\r\n\r\n```js\r\nconst nodegit = require('nodegit');\r\n\r\nnodegit.Repository.open('../nodegit').then(repo =\u003e {\r\n  return repo.getCommit('977251b4aae52eef75cf4f188b4d5a63ba98fa7b')\r\n}).then(commit =\u003e {\r\n  return commit.parent(0);\r\n}).then(parentCommit =\u003e {\r\n  return parentCommit.getTree();\r\n}).then(parentTree =\u003e {\r\n  console.log('parentTree: ' + parentTree);\r\n}).then(null, err =\u003e {\r\n  console.log('Error encountered\\n');\r\n  console.log(err);\r\n});\r\n```\r\n\r\n**Expected output:** `parentTree: [object Tree]`\r\n\r\n**Actual output:**\r\n\r\n```\r\nError encountered\r\n\r\nTypeError: Cannot read property 'getTree' of undefined\r\n    at Commit.getTree (node_modules/nodegit/dist/commit.js:302:20)\r\n    at nodegit.Repository.open.then.then.then.parentCommit (main.js:11:23)\r\n    at tryCallOne (node_modules/nodegit-promise/lib/core.js:37:12)\r\n    at node_modules/nodegit-promise/lib/core.js:103:15\r\n    at flush (node_modules/asap/raw.js:50:29)\r\n    at _combinedTickCallback (internal/process/next_tick.js:132:7)\r\n    at process._tickCallback (internal/process/next_tick.js:181:9)\r\n```\r\n\r\nIt looks like [this line](https://github.com/nodegit/nodegit/blob/7851e931a54ca487fb6556ab8713c94ac1719efb/lib/commit.js#L352) throws an exception because `this.repo` is `undefined`.","author":{"url":"https://github.com/rigdern","@type":"Person","name":"rigdern"},"datePublished":"2019-03-31T16:57:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1653/nodegit/issues/1653"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ab5529ec-6bfc-253a-246b-a45195817876
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD250:FE136:346ACF4:352211D:697039B4
html-safe-nonce8bfd7a0024708ccb39edb169efca5f16a15475b605b9b110c8eebf52d7c93cc5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjUwOkZFMTM2OjM0NkFDRjQ6MzUyMjExRDo2OTcwMzlCNCIsInZpc2l0b3JfaWQiOiI4MDg2NzA5MDEyNDU2ODE1MDI5IiwicmVnaW9uX2VkZ2UiOiJzZWEiLCJyZWdpb25fcmVuZGVyIjoic2VhIn0=
visitor-hmacb3a6fd61e7af781f9546407607a3875f5b06fbaf0b5114a8380a408aedf1369b
hovercard-subject-tagissue:427417997
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodegit/nodegit/1653/issue_layout
twitter:imagehttps://opengraph.githubassets.com/089680b5876b3d1cc18d3d8c3f99d6875904874383036828886a774aa751c9a4/nodegit/nodegit/issues/1653
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/089680b5876b3d1cc18d3d8c3f99d6875904874383036828886a774aa751c9a4/nodegit/nodegit/issues/1653
og:image:altSystem information node version: v8.12.0 yarn version: 1.5.1 OS/version/architecture: darwin/18.2.0/x64 Applicable nodegit version: nodegit@0.25.0-alpha.9 (also repros in 0.24.1 and 0.23.0) Repro H...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerigdern
hostnamegithub.com
expected-hostnamegithub.com
None9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2
turbo-cache-controlno-preview
go-importgithub.com/nodegit/nodegit git https://github.com/nodegit/nodegit.git
octolytics-dimension-user_id657068
octolytics-dimension-user_loginnodegit
octolytics-dimension-repository_id1383170
octolytics-dimension-repository_nwonodegit/nodegit
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1383170
octolytics-dimension-repository_network_root_nwonodegit/nodegit
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef643964067a552f02067066d6a910b2f90a5721f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodegit/nodegit/issues/1653#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodegit%2Fnodegit%2Fissues%2F1653
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodegit%2Fnodegit%2Fissues%2F1653
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodegit%2Fnodegit
Reloadhttps://github.com/nodegit/nodegit/issues/1653
Reloadhttps://github.com/nodegit/nodegit/issues/1653
Reloadhttps://github.com/nodegit/nodegit/issues/1653
nodegit https://github.com/nodegit
nodegithttps://github.com/nodegit/nodegit
Notifications https://github.com/login?return_to=%2Fnodegit%2Fnodegit
Fork 697 https://github.com/login?return_to=%2Fnodegit%2Fnodegit
Star 5.8k https://github.com/login?return_to=%2Fnodegit%2Fnodegit
Code https://github.com/nodegit/nodegit
Issues 343 https://github.com/nodegit/nodegit/issues
Pull requests 19 https://github.com/nodegit/nodegit/pulls
Actions https://github.com/nodegit/nodegit/actions
Projects 0 https://github.com/nodegit/nodegit/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/nodegit/nodegit/security
Please reload this pagehttps://github.com/nodegit/nodegit/issues/1653
Insights https://github.com/nodegit/nodegit/pulse
Code https://github.com/nodegit/nodegit
Issues https://github.com/nodegit/nodegit/issues
Pull requests https://github.com/nodegit/nodegit/pulls
Actions https://github.com/nodegit/nodegit/actions
Projects https://github.com/nodegit/nodegit/projects
Security https://github.com/nodegit/nodegit/security
Insights https://github.com/nodegit/nodegit/pulse
New issuehttps://github.com/login?return_to=https://github.com/nodegit/nodegit/issues/1653
New issuehttps://github.com/login?return_to=https://github.com/nodegit/nodegit/issues/1653
#1658https://github.com/nodegit/nodegit/pull/1658
getTree fails on result of commit.parent(0)https://github.com/nodegit/nodegit/issues/1653#top
#1658https://github.com/nodegit/nodegit/pull/1658
Bughttps://github.com/nodegit/nodegit/issues?q=state%3Aopen%20label%3A%22Bug%22
https://github.com/rigdern
https://github.com/rigdern
rigdernhttps://github.com/rigdern
on Mar 31, 2019https://github.com/nodegit/nodegit/issues/1653#issue-427417997
this linehttps://github.com/nodegit/nodegit/blob/7851e931a54ca487fb6556ab8713c94ac1719efb/lib/commit.js#L352
Bughttps://github.com/nodegit/nodegit/issues?q=state%3Aopen%20label%3A%22Bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.