Skip to content

require('path').Repo.open(...) returns {} #241

Description

@joshjung

Here is sample code of what I'm doing:

var path = require('path');

var GitService = function () {
  this.open = require("nodegit").Repo.open;
};

GitService.prototype = {
  log: function (repo, count, callback) {
   this.open('/home/joshua/skyduel/.git', function(error, repo) {
      if (error) throw error;
      console.log('repo opened', repo);
    });
  }
};

module.exports = GitService;

Console output when I run my wrapper application:

repo opened {}

Any ideas? I know for sure that the repo being requested exists, is freshly populated, and I can do git status on it and receive proper information.

Here is console output showing the git repo is properly initialized:

joshua@joshua-VirtualBox:~/skyduel$ pwd
/home/joshua/skyduel
joshua@joshua-VirtualBox:~/skyduel$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean
joshua@joshua-VirtualBox:~/skyduel$ npm list -g | grep nodegit
├─┬ nodegit@0.1.4
joshua@joshua-VirtualBox:~/skyduel$ 

nodegit@0.1.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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