nodegit / nodegit/nodegit

getReferences Callback is required

Open
#1,737 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.8k
Forks
704
PR merge metrics
No merged PRs in 30d

Description

System information

  • node version:
  • npm or yarn version:
  • OS/version/architecture:
  • Applicable nodegit version:
v12.12.0
6.11.3
darwin
19.0.0
x64

This seems like a bug:

import * as Git from "nodegit"

Git.Repository.open(".")
  .then(async repo => {
    return repo.getReferences(Git.Reference.TYPE.OID)
  })
  .catch(console.error)
❯ yarn -s ts-node test.ts
Error: Callback is required and must be a Function.
    at /Users/jasonkuhrt/projects/prisma-labs/libre/node_modules/nodegit-promise/lib/node-extensions.js:24:20
    at tryCallTwo (/Users/jasonkuhrt/projects/prisma-labs/libre/node_modules/nodegit-promise/lib/core.js:45:5)
    at doResolve (/Users/jasonkuhrt/projects/prisma-labs/libre/node_modules/nodegit-promise/lib/core.js:173:13)
    at new Promise (/Users/jasonkuhrt/projects/prisma-labs/libre/node_modules/nodegit-promise/lib/core.js:65:3)
    at Repository.getReferences (/Users/jasonkuhrt/projects/prisma-labs/libre/node_modules/nodegit-promise/lib/node-extensions.js:19:12)
    at /Users/jasonkuhrt/projects/prisma-labs/libre/test.ts:6:17
    at Generator.next (<anonymous>)
    at /Users/jasonkuhrt/projects/prisma-labs/libre/test.ts:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/jasonkuhrt/projects/prisma-labs/libre/test.ts:4:12)

Maybe related https://github.com/nodegit/nodegit/issues/1726

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the reported call in test.ts with Repository.getReferences in node-extensions.js and review the related issue #1726. Reproduce the shown Node/TypeScript example and inspect the existing promise/callback behavior; done means the call no longer raises the reported callback error and its references result can be observed.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.