Been trying to get branch switching working but I'm not having any luck. I found #523 and i think i'm using the right api calls, but every time I try this code with a non-master branch, it fails with the error mentioned in the title.
Not sure if it matters, but the repo I've been testing with is http://github.com/codeimpossible/Artigo. I've been trying to switch from master, to the gh-pages branch.
let repository;
let fetch = git.Repository.open('path/to/local/repo');
return fetch.then((repo) => {
repository = repo;
return repo.fetchAll();
})
.then(() => repository.getBranchCommit('non-master-branch'))
.then((commit) => git.Branch.create(repository, 'non-master-branch', commit, true))
.then(() => repository.checkoutBranch('non-master-branch'))
Also, I've tried calling Repository#getReference directly and that fails as well.