Skip to content

index.removeByPath stops execution #97

@dcolens

Description

@dcolens

trying to use removeByPath by using repo.openIndex, index.read, index.removeByPath and the scripts stops execution, no error, no logs, return code is 0.

[email protected]
node v0.10.13
OS: OSX 10.8.5

var git = require('nodegit')

git.Repo.open(repoPath, function(openError, repo) {
    if (openError) throw openError;
        repo.openIndex(function(openIndexError, index) {
        if (openIndexError) throw openIndexError;
        index.read(function(readError) {
            if (readError) throw readError;
            index.removeByPath(fileName, function(removeByPathError,r) {
                if (removeByPathError) throw removeByPathError; 
                console.log('ok');
            });
        });
    });
});

Steps to repro:

  • set repoPath to the path of a checked out repo
  • set fileName to the filename to delete from the repo

Expectations: prints 'ok' or throws removeByPathError
Actual: process stops without error.

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