WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Listing available branches #42

@adam-clarey

Description

@adam-clarey

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

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