refactor(github): don’t try/catch getBranchCommit

This commit is contained in:
Rhys Arkins 2018-07-26 21:28:10 +02:00
parent fa7b3b5643
commit 728b44d74a

View file

@ -1331,14 +1331,10 @@ async function createBlob(fileContents) {
// Return the commit SHA for a branch // Return the commit SHA for a branch
async function getBranchCommit(branchName) { async function getBranchCommit(branchName) {
try { const res = await get(
const res = await get( `repos/${config.repository}/git/refs/heads/${branchName}`
`repos/${config.repository}/git/refs/heads/${branchName}` );
); return res.body.object.sha;
return res.body.object.sha;
} catch (err) /* istanbul ignore next */ {
return null;
}
} }
async function getCommitDetails(commit) { async function getCommitDetails(commit) {