Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listing available branches #42

Open
adam-clarey opened this issue Apr 30, 2016 · 2 comments
Open

Listing available branches #42

adam-clarey opened this issue Apr 30, 2016 · 2 comments

Comments

@adam-clarey
Copy link

I thought this would be simple but I just can't figure how to get a list of available branches.

Ive tried:

nodegit.Repository.open(thisHook.context.vars.req.cookies.gitRepo).then(function (repo) {

    nodegit.Branch.iteratorNew(repo, nodegit.Branch.BRANCH.ALL).then(function(branchIterator) {

     // What to do here?
     // tried branchIterator.forEach(function(item) {});
     // tried Object.keys(branchIterator)

    });

    })
    .catch(function (err) {
    console.log(err);
  }).done(function () {
    console.log('Finished');
  });

What is branchiterator and how do you use it? I noticed in a different issue that the docs for this are still missing (#24).

Could someone please provide a little info on how to list branches?

Thanks, Adam

@ef4
Copy link

ef4 commented Jan 22, 2017

If I'm reading the source correctly, I don't think this feature is actually implemented.

@ef4
Copy link

ef4 commented Jan 23, 2017

As a workaround, there appears to be a working Reference.list(repo) method that gives enough information to derive the branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants