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
async function getBranchCommit(branchName) {
try {
const res = await get(
`repos/${config.repository}/git/refs/heads/${branchName}`
);
return res.body.object.sha;
} catch (err) /* istanbul ignore next */ {
return null;
}
const res = await get(
`repos/${config.repository}/git/refs/heads/${branchName}`
);
return res.body.object.sha;
}
async function getCommitDetails(commit) {