diff --git a/lib/platform/azure/index.ts b/lib/platform/azure/index.ts index 903c723509005b678724481ee715ed34ab945782..711fd0ba3d397192ec4ccba6c0d9123888633d60 100644 --- a/lib/platform/azure/index.ts +++ b/lib/platform/azure/index.ts @@ -48,7 +48,6 @@ interface Config { project: string; azureWorkItemId: string; prList: Pr[]; - fileList: null; repository: string; } @@ -182,10 +181,8 @@ export function getRepoForceRebase(): Promise<boolean> { // Search -export /* istanbul ignore next */ function getFileList( - branchName?: string -): Promise<string[]> { - return config.storage.getFileList(branchName); +export /* istanbul ignore next */ function getFileList(): Promise<string[]> { + return config.storage.getFileList(); } export /* istanbul ignore next */ async function setBaseBranch( @@ -194,9 +191,7 @@ export /* istanbul ignore next */ async function setBaseBranch( logger.debug(`Setting baseBranch to ${branchName}`); config.baseBranch = branchName; delete config.baseCommitSHA; - delete config.fileList; const baseBranchSha = await config.storage.setBaseBranch(branchName); - await getFileList(branchName); return baseBranchSha; } diff --git a/lib/platform/bitbucket-server/index.ts b/lib/platform/bitbucket-server/index.ts index 2d5f726bc57fb20055ebb46251ac061fabd5844e..3cdd5b269b077594f71a5b39d36f9b69af0e34f6 100644 --- a/lib/platform/bitbucket-server/index.ts +++ b/lib/platform/bitbucket-server/index.ts @@ -49,7 +49,6 @@ interface BbsConfig { baseBranch: string; bbUseDefaultReviewers: boolean; defaultBranch: string; - fileList: any[]; mergeMethod: string; owner: string; prList: Pr[]; @@ -273,11 +272,8 @@ export /* istanbul ignore next */ function setBranchPrefix( // Search // Get full file list -export function getFileList( - branchName: string = config.baseBranch -): Promise<string[]> { - logger.debug(`getFileList(${branchName})`); - return config.storage.getFileList(branchName); +export function getFileList(): Promise<string[]> { + return config.storage.getFileList(); } // Branch diff --git a/lib/platform/bitbucket/index.ts b/lib/platform/bitbucket/index.ts index d516a162c3c8a94e6e4dddefedfecd47b49f91b0..45f13da74f5bc1e9f59909e218471012d6895b38 100644 --- a/lib/platform/bitbucket/index.ts +++ b/lib/platform/bitbucket/index.ts @@ -173,8 +173,8 @@ export function getRepoForceRebase(): Promise<boolean> { // Search // Get full file list -export function getFileList(branchName?: string): Promise<string[]> { - return config.storage.getFileList(branchName); +export function getFileList(): Promise<string[]> { + return config.storage.getFileList(); } export async function setBaseBranch( @@ -183,9 +183,7 @@ export async function setBaseBranch( logger.debug(`Setting baseBranch to ${branchName}`); config.baseBranch = branchName; delete config.baseCommitSHA; - delete config.fileList; const baseBranchSha = await config.storage.setBaseBranch(branchName); - await getFileList(branchName); return baseBranchSha; } diff --git a/lib/platform/bitbucket/utils.ts b/lib/platform/bitbucket/utils.ts index 1461bf2860470732994ed016edb1ee53ea2c3d1e..c4721cbbeeedfbc04c282ff9fed7af7776868fdb 100644 --- a/lib/platform/bitbucket/utils.ts +++ b/lib/platform/bitbucket/utils.ts @@ -9,7 +9,6 @@ export interface Config { baseBranch: string; baseCommitSHA: string; defaultBranch: string; - fileList: any[]; has_issues: boolean; mergeMethod: string; owner: string; diff --git a/lib/platform/git/__snapshots__/storage.spec.ts.snap b/lib/platform/git/__snapshots__/storage.spec.ts.snap index bc7b2e88b0de37661d62a463e1962c519b9f3e6b..d008e251b5a7bcf88078ddf42217cba7f8461248 100644 --- a/lib/platform/git/__snapshots__/storage.spec.ts.snap +++ b/lib/platform/git/__snapshots__/storage.spec.ts.snap @@ -21,15 +21,6 @@ Array [ `; exports[`platform/git/storage getFileList() should return the correct files 1`] = ` -Array [ - "file_to_delete", - "future_file", - "master_file", - "past_file", -] -`; - -exports[`platform/git/storage getFileList() should return the correct files 2`] = ` Array [ "file_to_delete", "master_file", diff --git a/lib/platform/git/storage.spec.ts b/lib/platform/git/storage.spec.ts index bac0b0c7c86c134843f716ffc2ef7eb52c22acc6..2a299e636b425b1ec8bf83921d96d545374e63c9 100644 --- a/lib/platform/git/storage.spec.ts +++ b/lib/platform/git/storage.spec.ts @@ -82,11 +82,7 @@ describe('platform/git/storage', () => { }); }); describe('getFileList()', () => { - it('returns empty array if error', async () => { - expect(await git.getFileList('not_found')).toEqual([]); - }); it('should return the correct files', async () => { - expect(await git.getFileList('renovate/future_branch')).toMatchSnapshot(); expect(await git.getFileList()).toMatchSnapshot(); }); it('should exclude submodules', async () => { diff --git a/lib/platform/git/storage.ts b/lib/platform/git/storage.ts index 3f3757c35c37b9812cdbcb745f223a5d884fedfd..8e11ffa6b8c0cbcf57d30ae569ab446613626eb5 100644 --- a/lib/platform/git/storage.ts +++ b/lib/platform/git/storage.ts @@ -301,12 +301,8 @@ export class Storage { } } - async getFileList(branchName?: string): Promise<string[]> { - const branch = branchName || this._config.baseBranch; - const exists = await this.branchExists(branch); - if (!exists) { - return []; - } + async getFileList(): Promise<string[]> { + const branch = this._config.baseBranch; const submodules = await this.getSubmodules(); const files: string = await this._git.raw([ 'ls-tree', diff --git a/lib/platform/gitea/index.ts b/lib/platform/gitea/index.ts index cbdc65eb0f66989587137973b468a97cbed6a215..e50378ddf0bb80551886fe28ed9e9deaf42fa585 100644 --- a/lib/platform/gitea/index.ts +++ b/lib/platform/gitea/index.ts @@ -929,7 +929,7 @@ const platform: Platform = { }, getFileList(): Promise<string[]> { - return config.storage.getFileList(config.baseBranch); + return config.storage.getFileList(); }, getAllRenovateBranches(branchPrefix: string): Promise<string[]> { diff --git a/lib/platform/github/index.ts b/lib/platform/github/index.ts index d1080f761cdad02d3226252a44c987778032ff11..9a1e7d5be4647732a393087bfef798f7ccd19316 100644 --- a/lib/platform/github/index.ts +++ b/lib/platform/github/index.ts @@ -535,8 +535,8 @@ export function setBranchPrefix(branchPrefix: string): Promise<void> { // Search // istanbul ignore next -export function getFileList(branchName = config.baseBranch): Promise<string[]> { - return config.storage.getFileList(branchName); +export function getFileList(): Promise<string[]> { + return config.storage.getFileList(); } // Branch diff --git a/lib/platform/gitlab/index.ts b/lib/platform/gitlab/index.ts index e3c620e7b28616ac61174eb14441640c0ed45fa6..e5418ad2a4790d5216288ce16fa9af73420d9741 100644 --- a/lib/platform/gitlab/index.ts +++ b/lib/platform/gitlab/index.ts @@ -286,8 +286,8 @@ export /* istanbul ignore next */ function setBranchPrefix( // Search // Get full file list -export function getFileList(branchName = config.baseBranch): Promise<string[]> { - return config.storage.getFileList(branchName); +export function getFileList(): Promise<string[]> { + return config.storage.getFileList(); } // Returns true if branch exists, otherwise false