fix: correct error when remote repository has no branches

This commit is contained in:
Jozef Cipa
2020-01-27 11:59:38 -05:00
committed by Pierre Vanduynslager
parent b54b20d412
commit c6b10766a7
3 changed files with 29 additions and 10 deletions
+2 -2
View File
@@ -65,8 +65,8 @@ async function getCommits(from, to, execaOpts) {
async function getBranches(repositoryUrl, execaOpts) {
return (await execa('git', ['ls-remote', '--heads', repositoryUrl], execaOpts)).stdout
.split('\n')
.map(branch => branch.match(/^.+refs\/heads\/(?<branch>.+)$/)[1])
.filter(Boolean);
.filter(Boolean)
.map(branch => branch.match(/^.+refs\/heads\/(?<branch>.+)$/)[1]);
}
/**