Skip to content

getReference passes unexpected object into callback #98

Closed

Description

@micha149

Hey.

I just followed an example from example/general.js and tried to list all references of my repository. But the reference object, which is passed to my callback, is missing the methods .isOid() and .oid()

Here's the relevant except:

repo.getReference(referenceName, function(error, reference) {
    if (error) throw error;
    if (reference.isOid()) {
        console.log("Reference:", referenceName, reference.oid());
    } else if (reference.isSymbolic()) {
        console.log("Reference:", referenceName, reference.symbolicTarget());
    }
});

I have tried this with the latest release from npm registry and also with a fresh master clone. Same issues on both versions.

My configuration:

Node.js v0.10.0
nodegit v0.1.0
Mac OSX 10.8.5

Activity

  1. nkallen commented on Oct 1, 2013

    @nkallen
    Contributor

    Crap, sorry I believe the example is out of date.

    If you look in https://github.com/nodegit/nodegit/tree/master/lib/reference.js the methods are isConcrete and isSymbolic and symbolicTarget etc.

    Can you submit a pull request where you fix the example?

  2. micha149 commented on Oct 2, 2013

    @micha149
    ContributorAuthor

    OK, that works. I fixed the example code, but I'll have a look on the other examples, before I create a pull request. OK?

  3. added a commit that references this issue on Oct 4, 2013
    d706049
  4. micha149 commented on Oct 4, 2013

    @micha149
    ContributorAuthor

    Hey @nkallen,

    the fetch example throws a strange error message:

    Error: This transport isn't implemented. Sorry
    

    Isn't it still working?

  5. nkallen commented on Oct 4, 2013

    @nkallen
    Contributor

    Libgit only supports http protocol I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions