Title: `options` not reusable, nodegit destroys it · Issue #533 · nodegit/nodegit · GitHub
Open Graph Title: `options` not reusable, nodegit destroys it · Issue #533 · nodegit/nodegit
X Title: `options` not reusable, nodegit destroys it · Issue #533 · nodegit/nodegit
Description: https://github.com/nodegit/nodegit/blob/master/lib/clone.js#L21 Why are you doing this? This prevents reuse, e.g. I want to clone, and then fetch. let remoteOpts = { remoteCallbacks: { certificateCheck: function () { return 1; }, credent...
Open Graph Description: https://github.com/nodegit/nodegit/blob/master/lib/clone.js#L21 Why are you doing this? This prevents reuse, e.g. I want to clone, and then fetch. let remoteOpts = { remoteCallbacks: { certificateC...
X Description: https://github.com/nodegit/nodegit/blob/master/lib/clone.js#L21 Why are you doing this? This prevents reuse, e.g. I want to clone, and then fetch. let remoteOpts = { remoteCallbacks: { certificateC...
Opengraph URL: https://github.com/nodegit/nodegit/issues/533
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`options` not reusable, nodegit destroys it","articleBody":"https://github.com/nodegit/nodegit/blob/master/lib/clone.js#L21\n\nWhy are you doing this? This prevents reuse, e.g. I want to clone, and then fetch.\n\n``` js\nlet remoteOpts = {\n remoteCallbacks: {\n certificateCheck: function () {\n return 1;\n },\n credentials: function (url, username) {\n return git.Cred.sshKeyFromAgent(username);\n }\n }\n};\n\nfunction getFileFromBranch(branch, filePath) {\n let repository;\n\n return git.Repository.open(config.git.cloneTo)\n .catch(function (err) {\n if (err.message.startsWith('Failed to resolve')) {\n winston.info('Repo not found, cloning');\n\n // USED HERE\n return git.Clone(config.git.repo, config.git.cloneTo, remoteOpts);\n } else {\n winston.error(err);\n throw err;\n }\n })\n .then(function (repo) {\n repository = repo;\n\n winston.log('verbose', 'Changing branch');\n return repo.checkoutBranch(branch);\n })\n .catch(function (err) {\n if (/Reference '([^']+)' not found/.test(err.message)) {\n winston.info('Branch not found, fetching');\n\n // USED HERE\n let remoteCallbacks = remoteOpts.remoteCallbacks;\n return repository.fetch('origin', remoteCallbacks, true)\n .then(function () {\n return repository.checkoutBranch(branch);\n });\n } else {\n winston.error(err);\n throw err;\n }\n })\n .then(function () {\n return fs.readFile(path.join(config.git.cloneTo, filePath));\n });\n}\n```\n","author":{"url":"https://github.com/callumacrae","@type":"Person","name":"callumacrae"},"datePublished":"2015-04-09T11:04:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/533/nodegit/issues/533"}
| 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:3a8ce3f5-e137-66c7-2ecf-ac37bee08ce6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E392:35ACFF:3013F:40F1D:6A5FE443 |
| html-safe-nonce | 512a9a03659943f932d90eefe3e845bfe3779faadeacf72612ad04489ec27385 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzkyOjM1QUNGRjozMDEzRjo0MEYxRDo2QTVGRTQ0MyIsInZpc2l0b3JfaWQiOiIzMzMwNzE2ODk0NjcyOTcwODE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 870bd3501d3e7a384d0d9edb354e24e394f3874820d7711e66594c21f69f5f77 |
| hovercard-subject-tag | issue:67337027 |
| 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/533/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8aa44e5cc2a1ac6955c533a56b8c6406d7b8bb899ed038407650e06fc9d8255d/nodegit/nodegit/issues/533 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8aa44e5cc2a1ac6955c533a56b8c6406d7b8bb899ed038407650e06fc9d8255d/nodegit/nodegit/issues/533 |
| og:image:alt | https://github.com/nodegit/nodegit/blob/master/lib/clone.js#L21 Why are you doing this? This prevents reuse, e.g. I want to clone, and then fetch. let remoteOpts = { remoteCallbacks: { certificateC... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | callumacrae |
| hostname | github.com |
| expected-hostname | github.com |
| None | 78938542173c0d8e4ad1aefc7954896e81c10ce2620286603ef14cf593bd5a11 |
| 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 | 1a427601e09953033b696253e754ebc7328096a7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width