fix: reset file list when setting base branch (gitlab)

This commit is contained in:
Rhys Arkins 2018-02-03 10:39:04 +01:00
parent 03bdfe191f
commit 6101f25dc7
3 changed files with 14 additions and 10 deletions

View file

@ -108,9 +108,12 @@ function getRepoForceRebase() {
return false;
}
function setBaseBranch(branchName) {
async function setBaseBranch(branchName) {
if (branchName) {
logger.debug(`Setting baseBranch to ${branchName}`);
config.baseBranch = branchName;
delete config.fileList;
await getFileList(branchName);
}
}

View file

@ -290,4 +290,13 @@ Array [
exports[`platform/gitlab initRepo should initialise the config for the repo - 2 2`] = `Object {}`;
exports[`platform/gitlab setBaseBranch(branchName) sets the base branch 1`] = `Array []`;
exports[`platform/gitlab setBaseBranch(branchName) sets the base branch 1`] = `
Array [
Array [
"projects/undefined/repository/tree?ref=some-branch&recursive=true&per_page=100",
Object {
"paginate": true,
},
],
]
`;

View file

@ -136,14 +136,6 @@ describe('platform/gitlab', () => {
});
describe('setBaseBranch(branchName)', () => {
it('sets the base branch', async () => {
// getBranchCommit
get.mockImplementationOnce(() => ({
body: {
object: {
sha: '1238',
},
},
}));
await gitlab.setBaseBranch('some-branch');
expect(get.mock.calls).toMatchSnapshot();
});