src/indexOld.js
function init(){

        debug("Checking if there is a repository");
        return co(function*(){
            let repo;
            try {
                repo = yield nodegit.Repository.open(repositoryPath);
            } catch(err) {
                debug("Repository not found.");
                repo = yield _createRepository();
            }

            debug("Repository is ready");
            return repo;

        });
    }
function init(){

        debug("Checking if there is a repository");
        return co(function*(){
            let repo;
            try {
                repo = yield nodegit.Repository.open(repositoryPath);
            } catch(err) {
                debug("Repository not found.");
                repo = yield _createRepository();
            }

            debug("Repository is ready");
            return repo;

        });
    }
function init ( ) { debug ( "Checking if there is a repository" ) ; return co ( function * ( ) { let repo ; try { repo = yield nodegit . Repository . open ( repositoryPath ) ; } catch ( err ) { debug ( "Repository not found." ) ; repo = yield _createRepository ( ) ; } debug ( "Repository is ready" ) ; return repo ; } ) ; }
Initializes the repository connection
@method init
@returns {Promise} Repository connection
Initializes the repository connection