Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Cannot create a new branch #391

Copy link
Copy link
@ashokfernandez

Description

@ashokfernandez
Issue body actions

I am trying to create a new branch in my repo, however I am getting an error about a callback not existing. This is using version 0.2.7 from NPM

Git = require('nodegit');

scope = {}

Git.Repository.open("./")
    .then(function(repo) {
        scope.repo = repo;
        return repo.getMasterCommit();
    })
    .then(function(masterCommit) {
        scope.masterCommit = masterCommit;
        return Git.Branch.create(scope.repo, "new-branch", scope.masterCommit, true)
    })
    .then(function(branch) {
        console.log(branch.toString())
    })
    .catch(function(err) {
        console.log(err.toString())
    })

This results in the output

Error: Callback is required and must be a Function.
Reactions are currently unavailable

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.