Skip to content
Snippets Groups Projects
Commit 9572eaa6 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

refactor(github): getBranchList

parent ef70c48d
Branches
No related tags found
No related merge requests found
......@@ -40,8 +40,7 @@ class Storage {
branchList = null;
}
// Returns true if branch exists, otherwise false
async function branchExists(branchName) {
async function getBranchList() {
if (!branchList) {
logger.debug('Retrieving branchList');
branchList = (await get(
......@@ -52,7 +51,12 @@ class Storage {
)).body.map(branch => branch.name);
logger.debug({ branchList }, 'Retrieved branchList');
}
const res = branchList.includes(branchName);
return branchList;
}
// Returns true if branch exists, otherwise false
async function branchExists(branchName) {
const res = (await getBranchList()).includes(branchName);
logger.debug(`branchExists(${branchName})=${res}`);
return res;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment