mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
fix: reset file list when setting base branch (gitlab)
This commit is contained in:
parent
03bdfe191f
commit
6101f25dc7
3 changed files with 14 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue