Skip to content

nodegit doesn't return control to the calling application #497

Description

@dancrumb

I have the following code

var cloneOptions = {};
cloneOptions.remoteCallbacks = {
    credentials: function(url, userName) {
        return NodeGit.Cred.sshKeyFromAgent(userName);
    }
};
logger.info('Cloning snapshot repo');
var getMostRecentCommit = function(repository) {
    return repository.getBranchCommit('master');
};

var getCommitMessage = function(commit) {
    return commit.message();
};
NodeGit.Clone(remoteRepo, path.join('_deployments',deployFolderName), cloneOptions )
    .then(getMostRecentCommit, function() { logger.error('error %o', arguments);})
    .then(getCommitMessage, function() { logger.error('error %o', arguments);})
    .then(function(message) {
        return logger.info(message);
    }, function() { logger.error('error %o', arguments);});

This is largely copypasta from your site.

The NodeGit.* chain is working fine; the repo is being cloned and I'm getting the right commit message.

However, my application then just sits and waits. There's no indication in the nodegit docs that I need to manually resolve the Promise or anything like in order for my application to complete.

What am I missing here? Or is this a nodegit bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions