tbranyen/nodegit — Issue #35: repo has no method 'branch'
Author: cnzoupeng
Created: 2011-12-19 10:05:33+00:00
State: open

var git = require( 'nodegit' );

var repoDir = "/work/gitroot/cpptestprj/.git";

git.repo(repoDir, function( err, repo )
{
if( err ) { throw err; }

repo.branch( 'master', function( err, branch )
{
if( err ) { throw err;
}

branch.tree().walk().on('entry', function( idx, entry )
{
console.log( entry.name, entry.attributes );
});
});
});

//----------------------------

zoupeng@ubuntu:/work/www$ node gittest.js

/work/gitroot/sourcecode/webide/gittest.js:10
repo.branch( 'master', function( err, branch )
^
TypeError: Object #