mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 23:16:26 +00:00
refactor(github): don’t try/catch getBranchCommit
This commit is contained in:
parent
fa7b3b5643
commit
728b44d74a
1 changed files with 4 additions and 8 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue