From 0b287c763d07ef42ff17cd8186fdc6faffbeb05a Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Wed, 26 May 2021 10:30:23 +0200
Subject: [PATCH] refactor: localDir -> cloneDir (#10158)

---
 lib/config/admin.ts                           |  2 +-
 lib/config/types.ts                           |  4 +--
 lib/datasource/crate/index.spec.ts            |  2 +-
 lib/manager/batect/extract.spec.ts            |  2 +-
 lib/manager/bundler/artifacts.spec.ts         |  2 +-
 lib/manager/cargo/artifacts.spec.ts           |  2 +-
 lib/manager/cargo/extract.spec.ts             |  2 +-
 lib/manager/cocoapods/artifacts.spec.ts       |  4 +--
 lib/manager/cocoapods/extract.spec.ts         |  2 +-
 lib/manager/composer/artifacts.spec.ts        |  2 +-
 lib/manager/git-submodules/extract.spec.ts    |  2 +-
 lib/manager/git-submodules/extract.ts         |  6 ++--
 lib/manager/git-submodules/update.spec.ts     |  2 +-
 lib/manager/git-submodules/update.ts          |  6 ++--
 lib/manager/gitlabci/extract.spec.ts          |  2 +-
 lib/manager/gomod/artifacts.spec.ts           |  2 +-
 .../gradle-wrapper/artifacts-real.spec.ts     |  8 ++---
 lib/manager/gradle-wrapper/artifacts.spec.ts  |  4 +--
 lib/manager/gradle-wrapper/artifacts.ts       |  2 +-
 lib/manager/gradle/gradle-updates-report.ts   | 12 +++----
 lib/manager/gradle/index-real.spec.ts         |  2 +-
 lib/manager/gradle/index.spec.ts              |  2 +-
 lib/manager/gradle/index.ts                   |  6 ++--
 lib/manager/helmv3/artifacts.spec.ts          |  2 +-
 lib/manager/mix/artifacts.spec.ts             |  2 +-
 lib/manager/mix/extract.spec.ts               |  2 +-
 lib/manager/npm/extract/pnpm.spec.ts          |  2 +-
 lib/manager/npm/post-update/index.ts          | 34 +++++++++----------
 lib/manager/nuget/artifacts.spec.ts           |  2 +-
 lib/manager/nuget/artifacts.ts                |  4 +--
 lib/manager/nuget/extract.spec.ts             |  2 +-
 lib/manager/nuget/extract.ts                  |  4 +--
 lib/manager/nuget/util.ts                     |  4 +--
 .../pip_requirements/artifacts.spec.ts        |  2 +-
 lib/manager/pip_setup/extract.spec.ts         |  2 +-
 lib/manager/pip_setup/index.spec.ts           |  2 +-
 lib/manager/pipenv/artifacts.spec.ts          |  2 +-
 lib/manager/poetry/artifacts.spec.ts          |  2 +-
 lib/util/exec/docker/index.ts                 |  4 +--
 lib/util/exec/exec.spec.ts                    |  2 +-
 lib/util/exec/index.ts                        |  6 ++--
 lib/util/fs/index.spec.ts                     |  6 ++--
 lib/util/fs/index.ts                          | 28 +++++++--------
 lib/util/git/index.spec.ts                    |  2 +-
 lib/util/git/index.ts                         | 20 +++++------
 .../branch/execute-post-upgrade-commands.ts   |  2 +-
 lib/workers/branch/index.spec.ts              | 22 ++++++------
 lib/workers/branch/lock-files/index.spec.ts   |  4 +--
 lib/workers/global/index.ts                   |  4 +--
 lib/workers/repository/index.spec.ts          |  2 +-
 lib/workers/repository/index.ts               | 10 +++---
 lib/workers/repository/init/index.spec.ts     |  2 +-
 52 files changed, 131 insertions(+), 131 deletions(-)

diff --git a/lib/config/admin.ts b/lib/config/admin.ts
index 73f289d209..f560d59ead 100644
--- a/lib/config/admin.ts
+++ b/lib/config/admin.ts
@@ -16,7 +16,7 @@ const repoAdminOptions = [
   'exposeAllEnv',
   'migratePresets',
   'privateKey',
-  'localDir',
+  'cloneDir',
   'cacheDir',
 ];
 
diff --git a/lib/config/types.ts b/lib/config/types.ts
index bd56a58505..4094f0b5de 100644
--- a/lib/config/types.ts
+++ b/lib/config/types.ts
@@ -98,14 +98,14 @@ export interface RepoAdminConfig {
   exposeAllEnv?: boolean;
   migratePresets?: Record<string, string>;
   privateKey?: string | Buffer;
-  localDir?: string;
+  cloneDir?: string;
   cacheDir?: string;
 }
 
 export interface LegacyAdminConfig {
   endpoint?: string;
 
-  localDir?: string;
+  cloneDir?: string;
 
   logContext?: string;
 
diff --git a/lib/datasource/crate/index.spec.ts b/lib/datasource/crate/index.spec.ts
index 00ae5986f2..b367998add 100644
--- a/lib/datasource/crate/index.spec.ts
+++ b/lib/datasource/crate/index.spec.ts
@@ -83,7 +83,7 @@ describe(getName(), () => {
       tmpDir = await dir();
 
       adminConfig = {
-        localDir: join(tmpDir.path, 'local'),
+        cloneDir: join(tmpDir.path, 'local'),
         cacheDir: join(tmpDir.path, 'cache'),
       };
       setAdminConfig(adminConfig);
diff --git a/lib/manager/batect/extract.spec.ts b/lib/manager/batect/extract.spec.ts
index 9596f4b7bb..8d1640fb65 100644
--- a/lib/manager/batect/extract.spec.ts
+++ b/lib/manager/batect/extract.spec.ts
@@ -28,7 +28,7 @@ function createGitDependency(repo: string, version: string): PackageDependency {
 }
 
 const adminConfig: RepoAdminConfig = {
-  localDir: '',
+  cloneDir: '',
 };
 
 const config: ExtractConfig = {};
diff --git a/lib/manager/bundler/artifacts.spec.ts b/lib/manager/bundler/artifacts.spec.ts
index 05cf2d6ca7..78b1b33a5c 100644
--- a/lib/manager/bundler/artifacts.spec.ts
+++ b/lib/manager/bundler/artifacts.spec.ts
@@ -30,7 +30,7 @@ jest.mock('./host-rules');
 
 const adminConfig: RepoAdminConfig = {
   // `join` fixes Windows CI
-  localDir: join('/tmp/github/some/repo'),
+  cloneDir: join('/tmp/github/some/repo'),
   cacheDir: join('/tmp/cache'),
 };
 
diff --git a/lib/manager/cargo/artifacts.spec.ts b/lib/manager/cargo/artifacts.spec.ts
index a2c8bf0fc3..397212c816 100644
--- a/lib/manager/cargo/artifacts.spec.ts
+++ b/lib/manager/cargo/artifacts.spec.ts
@@ -26,7 +26,7 @@ const config: UpdateArtifactsConfig = {};
 
 const adminConfig: RepoAdminConfig = {
   // `join` fixes Windows CI
-  localDir: join('/tmp/github/some/repo'),
+  cloneDir: join('/tmp/github/some/repo'),
 };
 
 describe('.updateArtifacts()', () => {
diff --git a/lib/manager/cargo/extract.spec.ts b/lib/manager/cargo/extract.spec.ts
index 25cd4087e2..d6356fbe20 100644
--- a/lib/manager/cargo/extract.spec.ts
+++ b/lib/manager/cargo/extract.spec.ts
@@ -24,7 +24,7 @@ describe(getName(), () => {
       config = {};
       const tmpDir = await dir();
       adminConfig = {
-        localDir: join(tmpDir.path, 'local'),
+        cloneDir: join(tmpDir.path, 'local'),
         cacheDir: join(tmpDir.path, 'cache'),
       };
 
diff --git a/lib/manager/cocoapods/artifacts.spec.ts b/lib/manager/cocoapods/artifacts.spec.ts
index 2944f67e22..836cfb2a5c 100644
--- a/lib/manager/cocoapods/artifacts.spec.ts
+++ b/lib/manager/cocoapods/artifacts.spec.ts
@@ -30,7 +30,7 @@ delete process.env.CP_HOME_DIR;
 const config: UpdateArtifactsConfig = {};
 
 const adminConfig: RepoAdminConfig = {
-  localDir: join('/tmp/github/some/repo'),
+  cloneDir: join('/tmp/github/some/repo'),
   cacheDir: join('/tmp/cache'),
 };
 
@@ -83,7 +83,7 @@ describe('.updateArtifacts()', () => {
   it('returns null for invalid local directory', async () => {
     const execSnapshots = mockExecAll(exec);
     setAdminConfig({
-      localDir: '',
+      cloneDir: '',
     });
 
     expect(
diff --git a/lib/manager/cocoapods/extract.spec.ts b/lib/manager/cocoapods/extract.spec.ts
index 6ae2c5c649..1461fba6bd 100644
--- a/lib/manager/cocoapods/extract.spec.ts
+++ b/lib/manager/cocoapods/extract.spec.ts
@@ -7,7 +7,7 @@ const simplePodfile = loadFixture('Podfile.simple');
 const complexPodfile = loadFixture('Podfile.complex');
 
 const adminConfig: RepoAdminConfig = {
-  localDir: '',
+  cloneDir: '',
 };
 
 describe(getName(), () => {
diff --git a/lib/manager/composer/artifacts.spec.ts b/lib/manager/composer/artifacts.spec.ts
index 23218407a9..c5f6ce4e9c 100644
--- a/lib/manager/composer/artifacts.spec.ts
+++ b/lib/manager/composer/artifacts.spec.ts
@@ -35,7 +35,7 @@ const config: UpdateArtifactsConfig = {
 const adminConfig: RepoAdminConfig = {
   allowScripts: false,
   // `join` fixes Windows CI
-  localDir: join('/tmp/github/some/repo'),
+  cloneDir: join('/tmp/github/some/repo'),
   cacheDir: join('/tmp/renovate/cache'),
 };
 
diff --git a/lib/manager/git-submodules/extract.spec.ts b/lib/manager/git-submodules/extract.spec.ts
index 89d2826460..1588172d17 100644
--- a/lib/manager/git-submodules/extract.spec.ts
+++ b/lib/manager/git-submodules/extract.spec.ts
@@ -44,7 +44,7 @@ describe(getName(), () => {
   });
   describe('extractPackageFile()', () => {
     it('extracts submodules', async () => {
-      setAdminConfig({ localDir: `${__dirname}/__fixtures__` });
+      setAdminConfig({ cloneDir: `${__dirname}/__fixtures__` });
       hostRules.add({ matchHost: 'github.com', token: 'abc123' });
       let res: PackageFile;
       expect(await extractPackageFile('', '.gitmodules.1', {})).toBeNull();
diff --git a/lib/manager/git-submodules/extract.ts b/lib/manager/git-submodules/extract.ts
index 7c92f1b13f..a835367bab 100644
--- a/lib/manager/git-submodules/extract.ts
+++ b/lib/manager/git-submodules/extract.ts
@@ -88,9 +88,9 @@ export default async function extractPackageFile(
   fileName: string,
   config: ManagerConfig
 ): Promise<PackageFile | null> {
-  const { localDir } = getAdminConfig();
-  const git = Git(localDir);
-  const gitModulesPath = upath.join(localDir, fileName);
+  const { cloneDir } = getAdminConfig();
+  const git = Git(cloneDir);
+  const gitModulesPath = upath.join(cloneDir, fileName);
 
   const depNames = await getModules(git, gitModulesPath);
 
diff --git a/lib/manager/git-submodules/update.spec.ts b/lib/manager/git-submodules/update.spec.ts
index 9887e7ceb8..b4069c7b77 100644
--- a/lib/manager/git-submodules/update.spec.ts
+++ b/lib/manager/git-submodules/update.spec.ts
@@ -18,7 +18,7 @@ describe(getName(), () => {
       upgrade = { depName: 'renovate' };
 
       const tmpDir = await dir();
-      adminConfig = { localDir: join(tmpDir.path) };
+      adminConfig = { cloneDir: join(tmpDir.path) };
       setAdminConfig(adminConfig);
     });
     afterAll(() => {
diff --git a/lib/manager/git-submodules/update.ts b/lib/manager/git-submodules/update.ts
index da05a5ae46..7df8506c22 100644
--- a/lib/manager/git-submodules/update.ts
+++ b/lib/manager/git-submodules/update.ts
@@ -8,9 +8,9 @@ export default async function updateDependency({
   fileContent,
   upgrade,
 }: UpdateDependencyConfig): Promise<string | null> {
-  const { localDir } = getAdminConfig();
-  const git = Git(localDir);
-  const submoduleGit = Git(upath.join(localDir, upgrade.depName));
+  const { cloneDir } = getAdminConfig();
+  const git = Git(cloneDir);
+  const submoduleGit = Git(upath.join(cloneDir, upgrade.depName));
 
   try {
     await git.submoduleUpdate(['--init', upgrade.depName]);
diff --git a/lib/manager/gitlabci/extract.spec.ts b/lib/manager/gitlabci/extract.spec.ts
index ae3f1f3076..9e1faf537b 100644
--- a/lib/manager/gitlabci/extract.spec.ts
+++ b/lib/manager/gitlabci/extract.spec.ts
@@ -6,7 +6,7 @@ import { extractAllPackageFiles } from './extract';
 
 const config: ExtractConfig = {};
 
-const adminConfig: RepoAdminConfig = { localDir: '' };
+const adminConfig: RepoAdminConfig = { cloneDir: '' };
 
 describe(getName(), () => {
   beforeEach(() => {
diff --git a/lib/manager/gomod/artifacts.spec.ts b/lib/manager/gomod/artifacts.spec.ts
index 0d5f5db948..e37e529aa3 100644
--- a/lib/manager/gomod/artifacts.spec.ts
+++ b/lib/manager/gomod/artifacts.spec.ts
@@ -40,7 +40,7 @@ replace github.com/pkg/errors => ../errors
 
 const adminConfig: RepoAdminConfig = {
   // `join` fixes Windows CI
-  localDir: join('/tmp/github/some/repo'),
+  cloneDir: join('/tmp/github/some/repo'),
   cacheDir: join('/tmp/renovate/cache'),
 };
 
diff --git a/lib/manager/gradle-wrapper/artifacts-real.spec.ts b/lib/manager/gradle-wrapper/artifacts-real.spec.ts
index 3df9468491..c1542f06e5 100644
--- a/lib/manager/gradle-wrapper/artifacts-real.spec.ts
+++ b/lib/manager/gradle-wrapper/artifacts-real.spec.ts
@@ -16,7 +16,7 @@ jest.mock('../../util/git');
 const fixtures = resolve(__dirname, './__fixtures__');
 
 const adminConfig: RepoAdminConfig = {
-  localDir: resolve(fixtures, './testFiles'),
+  cloneDir: resolve(fixtures, './testFiles'),
 };
 
 const config: UpdateArtifactsConfig = {
@@ -169,7 +169,7 @@ describe(getName(), () => {
     it('gradlew failed', async () => {
       const wrongCmdConfig = {
         ...adminConfig,
-        localDir: resolve(fixtures, './wrongCmd'),
+        cloneDir: resolve(fixtures, './wrongCmd'),
       };
 
       await setExecConfig(wrongCmdConfig);
@@ -196,7 +196,7 @@ describe(getName(), () => {
     });
 
     it('gradlew not found', async () => {
-      setAdminConfig({ localDir: 'some-dir' });
+      setAdminConfig({ cloneDir: 'some-dir' });
       const res = await dcUpdate.updateArtifacts({
         packageFileName: 'gradle-wrapper.properties',
         updatedDeps: [],
@@ -243,7 +243,7 @@ describe(getName(), () => {
 
       expect(
         await readString(
-          adminConfig.localDir,
+          adminConfig.cloneDir,
           `./gradle/wrapper/gradle-wrapper.properties`
         )
       ).toEqual(newContent);
diff --git a/lib/manager/gradle-wrapper/artifacts.spec.ts b/lib/manager/gradle-wrapper/artifacts.spec.ts
index 16f92f1dd0..446d981150 100644
--- a/lib/manager/gradle-wrapper/artifacts.spec.ts
+++ b/lib/manager/gradle-wrapper/artifacts.spec.ts
@@ -30,7 +30,7 @@ const exec: jest.Mock<typeof _exec> = _exec as any;
 const fixtures = resolve(__dirname, './__fixtures__');
 
 const adminConfig: RepoAdminConfig = {
-  localDir: resolve(fixtures, './testFiles'),
+  cloneDir: resolve(fixtures, './testFiles'),
 };
 
 const dockerAdminConfig = { ...adminConfig, binarySource: BinarySource.Docker };
@@ -105,7 +105,7 @@ describe(getName(), () => {
   });
 
   it('gradlew not found', async () => {
-    setAdminConfig({ ...adminConfig, localDir: 'some-dir' });
+    setAdminConfig({ ...adminConfig, cloneDir: 'some-dir' });
     const res = await dcUpdate.updateArtifacts({
       packageFileName: 'gradle-wrapper.properties',
       updatedDeps: [],
diff --git a/lib/manager/gradle-wrapper/artifacts.ts b/lib/manager/gradle-wrapper/artifacts.ts
index e377604b26..9eee8f75da 100644
--- a/lib/manager/gradle-wrapper/artifacts.ts
+++ b/lib/manager/gradle-wrapper/artifacts.ts
@@ -55,7 +55,7 @@ export async function updateArtifacts({
   config,
 }: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {
   try {
-    const { localDir: projectDir } = getAdminConfig();
+    const { cloneDir: projectDir } = getAdminConfig();
     logger.debug({ updatedDeps }, 'gradle-wrapper.updateArtifacts()');
     const gradlew = gradleWrapperFileName(config);
     const gradlewPath = resolve(projectDir, `./${gradlew}`);
diff --git a/lib/manager/gradle/gradle-updates-report.ts b/lib/manager/gradle/gradle-updates-report.ts
index e90ca89600..2c428f1c1f 100644
--- a/lib/manager/gradle/gradle-updates-report.ts
+++ b/lib/manager/gradle/gradle-updates-report.ts
@@ -11,7 +11,7 @@ import type {
 export const GRADLE_DEPENDENCY_REPORT_FILENAME = 'gradle-renovate-report.json';
 
 export async function createRenovateGradlePlugin(
-  localDir: string
+  cloneDir: string
 ): Promise<void> {
   const content = `
 import groovy.json.JsonOutput
@@ -47,16 +47,16 @@ gradle.buildFinished {
    def json = JsonOutput.toJson(output)
    outputFile.write json
 }`;
-  const gradleInitFile = join(localDir, 'renovate-plugin.gradle');
+  const gradleInitFile = join(cloneDir, 'renovate-plugin.gradle');
   logger.debug(
     'Creating renovate-plugin.gradle file with renovate gradle plugin'
   );
   await writeFile(gradleInitFile, content);
 }
 
-async function readGradleReport(localDir: string): Promise<GradleProject[]> {
+async function readGradleReport(cloneDir: string): Promise<GradleProject[]> {
   const renovateReportFilename = join(
-    localDir,
+    cloneDir,
     GRADLE_DEPENDENCY_REPORT_FILENAME
   );
   if (!(await exists(renovateReportFilename))) {
@@ -123,9 +123,9 @@ function buildDependency(
 }
 
 export async function extractDependenciesFromUpdatesReport(
-  localDir: string
+  cloneDir: string
 ): Promise<BuildDependency[]> {
-  const gradleProjectConfigurations = await readGradleReport(localDir);
+  const gradleProjectConfigurations = await readGradleReport(cloneDir);
 
   const dependencies = gradleProjectConfigurations
     .map(mergeDependenciesWithRepositories, [])
diff --git a/lib/manager/gradle/index-real.spec.ts b/lib/manager/gradle/index-real.spec.ts
index 0b126bff9b..758ff1e0fe 100644
--- a/lib/manager/gradle/index-real.spec.ts
+++ b/lib/manager/gradle/index-real.spec.ts
@@ -26,7 +26,7 @@ describe(getName(), () => {
     beforeEach(async () => {
       workingDir = await tmp.dir({ unsafeCleanup: true });
       successFile = '';
-      adminConfig = { localDir: workingDir.path };
+      adminConfig = { cloneDir: workingDir.path };
       setAdminConfig(adminConfig);
       testRunConfig = { ...baseConfig };
       await fsExtra.copy(`${fixtures}/minimal-project`, workingDir.path);
diff --git a/lib/manager/gradle/index.spec.ts b/lib/manager/gradle/index.spec.ts
index 7171b2ac81..93bb0dfc24 100644
--- a/lib/manager/gradle/index.spec.ts
+++ b/lib/manager/gradle/index.spec.ts
@@ -29,7 +29,7 @@ jest.mock('../../util/exec/env');
 const env = mocked(_env);
 
 const adminConfig: RepoAdminConfig = {
-  localDir: join('/foo/bar'),
+  cloneDir: join('/foo/bar'),
 };
 
 const dockerAdminConfig = {
diff --git a/lib/manager/gradle/index.ts b/lib/manager/gradle/index.ts
index a463bb45e5..af651177ee 100644
--- a/lib/manager/gradle/index.ts
+++ b/lib/manager/gradle/index.ts
@@ -93,11 +93,11 @@ export async function extractAllPackageFiles(
 ): Promise<PackageFile[] | null> {
   let rootBuildGradle: string | undefined;
   let gradlew: Stats | null;
-  const { localDir } = getAdminConfig();
+  const { cloneDir } = getAdminConfig();
   for (const packageFile of packageFiles) {
     const dirname = upath.dirname(packageFile);
     const gradlewPath = upath.join(dirname, gradleWrapperFileName(config));
-    gradlew = await stat(upath.join(localDir, gradlewPath)).catch(() => null);
+    gradlew = await stat(upath.join(cloneDir, gradlewPath)).catch(() => null);
 
     if (['build.gradle', 'build.gradle.kts'].includes(packageFile)) {
       rootBuildGradle = packageFile;
@@ -116,7 +116,7 @@ export async function extractAllPackageFiles(
   }
   logger.debug('Extracting dependencies from all gradle files');
 
-  const cwd = upath.join(localDir, upath.dirname(rootBuildGradle));
+  const cwd = upath.join(cloneDir, upath.dirname(rootBuildGradle));
 
   await createRenovateGradlePlugin(cwd);
   await executeGradle(config, cwd, gradlew);
diff --git a/lib/manager/helmv3/artifacts.spec.ts b/lib/manager/helmv3/artifacts.spec.ts
index 0fcb69da2b..f6c6035489 100644
--- a/lib/manager/helmv3/artifacts.spec.ts
+++ b/lib/manager/helmv3/artifacts.spec.ts
@@ -23,7 +23,7 @@ const exec: jest.Mock<typeof _exec> = _exec as any;
 const env = mocked(_env);
 
 const adminConfig: RepoAdminConfig = {
-  localDir: join('/tmp/github/some/repo'), // `join` fixes Windows CI
+  cloneDir: join('/tmp/github/some/repo'), // `join` fixes Windows CI
 };
 
 const config: UpdateArtifactsConfig = {};
diff --git a/lib/manager/mix/artifacts.spec.ts b/lib/manager/mix/artifacts.spec.ts
index 16824a564b..8fee8421c6 100644
--- a/lib/manager/mix/artifacts.spec.ts
+++ b/lib/manager/mix/artifacts.spec.ts
@@ -15,7 +15,7 @@ jest.mock('../../util/fs');
 
 const adminConfig: RepoAdminConfig = {
   // `join` fixes Windows CI
-  localDir: join('/tmp/github/some/repo'),
+  cloneDir: join('/tmp/github/some/repo'),
 };
 
 const config: UpdateArtifactsConfig = {};
diff --git a/lib/manager/mix/extract.spec.ts b/lib/manager/mix/extract.spec.ts
index 0a452b6d39..c4b1dc3b3b 100644
--- a/lib/manager/mix/extract.spec.ts
+++ b/lib/manager/mix/extract.spec.ts
@@ -6,7 +6,7 @@ const sample = loadFixture('mix.exs');
 
 describe(getName(), () => {
   beforeEach(() => {
-    setAdminConfig({ localDir: '' });
+    setAdminConfig({ cloneDir: '' });
   });
 
   describe('extractPackageFile()', () => {
diff --git a/lib/manager/npm/extract/pnpm.spec.ts b/lib/manager/npm/extract/pnpm.spec.ts
index b0ade19f8d..dadb9225e0 100644
--- a/lib/manager/npm/extract/pnpm.spec.ts
+++ b/lib/manager/npm/extract/pnpm.spec.ts
@@ -10,7 +10,7 @@ import {
 
 describe(getName(), () => {
   beforeAll(() => {
-    setAdminConfig({ localDir: getFixturePath('pnpm-monorepo/', '..') });
+    setAdminConfig({ cloneDir: getFixturePath('pnpm-monorepo/', '..') });
   });
 
   describe('.extractPnpmFilters()', () => {
diff --git a/lib/manager/npm/post-update/index.ts b/lib/manager/npm/post-update/index.ts
index 1e45616c59..f37b5f5490 100644
--- a/lib/manager/npm/post-update/index.ts
+++ b/lib/manager/npm/post-update/index.ts
@@ -139,10 +139,10 @@ export async function writeExistingFiles(
     { packageFiles: npmFiles.map((n) => n.packageFile) },
     'Writing package.json files'
   );
-  const { localDir } = getAdminConfig();
+  const { cloneDir } = getAdminConfig();
   for (const packageFile of npmFiles) {
     const basedir = upath.join(
-      localDir,
+      cloneDir,
       upath.dirname(packageFile.packageFile)
     );
     const npmrc: string = packageFile.npmrc || config.npmrc;
@@ -170,7 +170,7 @@ export async function writeExistingFiles(
     }
     const { npmLock } = packageFile;
     if (npmLock) {
-      const npmLockPath = upath.join(localDir, npmLock);
+      const npmLockPath = upath.join(cloneDir, npmLock);
       if (
         process.env.RENOVATE_REUSE_PACKAGE_LOCK === 'false' ||
         config.reuseLockFiles === false
@@ -232,12 +232,12 @@ export async function writeUpdatedPackageFiles(
     logger.debug('No files found');
     return;
   }
-  const { localDir } = getAdminConfig();
+  const { cloneDir } = getAdminConfig();
   for (const packageFile of config.updatedPackageFiles) {
     if (packageFile.name.endsWith('package-lock.json')) {
       logger.debug(`Writing package-lock file: ${packageFile.name}`);
       await outputFile(
-        upath.join(localDir, packageFile.name),
+        upath.join(cloneDir, packageFile.name),
         packageFile.contents
       );
       continue; // eslint-disable-line
@@ -266,7 +266,7 @@ export async function writeUpdatedPackageFiles(
       logger.warn({ err }, 'Error adding token to package files');
     }
     await outputFile(
-      upath.join(localDir, packageFile.name),
+      upath.join(cloneDir, packageFile.name),
       JSON.stringify(massagedFile)
     );
   }
@@ -332,7 +332,7 @@ async function resetNpmrcContent(
 // istanbul ignore next
 async function updateYarnOffline(
   lockFileDir: string,
-  localDir: string,
+  cloneDir: string,
   updatedArtifacts: UpdatedArtifacts[]
 ): Promise<void> {
   try {
@@ -372,7 +372,7 @@ async function updateYarnOffline(
       const status = await getRepoStatus();
       for (const f of status.modified.concat(status.not_added)) {
         if (resolvedPaths.some((p) => f.startsWith(p))) {
-          const localModified = upath.join(localDir, f);
+          const localModified = upath.join(cloneDir, f);
           updatedArtifacts.push({
             name: f,
             contents: await readFile(localModified),
@@ -463,10 +463,10 @@ export async function getAdditionalFiles(
   } catch (err) {
     logger.warn({ err }, 'Error getting token for packageFile');
   }
-  const { localDir } = getAdminConfig();
+  const { cloneDir } = getAdminConfig();
   for (const npmLock of dirs.npmLockDirs) {
     const lockFileDir = upath.dirname(npmLock);
-    const fullLockFileDir = upath.join(localDir, lockFileDir);
+    const fullLockFileDir = upath.join(cloneDir, lockFileDir);
     const npmrcContent = await getNpmrcContent(fullLockFileDir);
     await updateNpmrcContent(
       fullLockFileDir,
@@ -529,7 +529,7 @@ export async function getAdditionalFiles(
 
   for (const yarnLock of dirs.yarnLockDirs) {
     const lockFileDir = upath.dirname(yarnLock);
-    const fullLockFileDir = upath.join(localDir, lockFileDir);
+    const fullLockFileDir = upath.join(cloneDir, lockFileDir);
     const npmrcContent = await getNpmrcContent(fullLockFileDir);
     await updateNpmrcContent(
       fullLockFileDir,
@@ -561,7 +561,7 @@ export async function getAdditionalFiles(
       (upgrade) => upgrade.yarnLock === yarnLock
     );
     const res = await yarn.generateLockFile(
-      upath.join(localDir, lockFileDir),
+      upath.join(cloneDir, lockFileDir),
       env,
       config,
       upgrades
@@ -607,7 +607,7 @@ export async function getAdditionalFiles(
           name: lockFileName,
           contents: res.lockFile,
         });
-        await updateYarnOffline(lockFileDir, localDir, updatedArtifacts);
+        await updateYarnOffline(lockFileDir, cloneDir, updatedArtifacts);
       }
     }
     await resetNpmrcContent(fullLockFileDir, npmrcContent);
@@ -618,7 +618,7 @@ export async function getAdditionalFiles(
 
   for (const pnpmShrinkwrap of dirs.pnpmShrinkwrapDirs) {
     const lockFileDir = upath.dirname(pnpmShrinkwrap);
-    const fullLockFileDir = upath.join(localDir, lockFileDir);
+    const fullLockFileDir = upath.join(cloneDir, lockFileDir);
     const npmrcContent = await getNpmrcContent(fullLockFileDir);
     await updateNpmrcContent(
       fullLockFileDir,
@@ -630,7 +630,7 @@ export async function getAdditionalFiles(
       (upgrade) => upgrade.pnpmShrinkwrap === pnpmShrinkwrap
     );
     const res = await pnpm.generateLockFile(
-      upath.join(localDir, lockFileDir),
+      upath.join(cloneDir, lockFileDir),
       env,
       config,
       upgrades
@@ -697,7 +697,7 @@ export async function getAdditionalFiles(
     const skipInstalls =
       lockFile === 'npm-shrinkwrap.json' ? false : config.skipInstalls;
     const fullLearnaFileDir = upath.join(
-      localDir,
+      cloneDir,
       getSubDirectory(lernaJsonFile)
     );
     const npmrcContent = await getNpmrcContent(fullLearnaFileDir);
@@ -769,7 +769,7 @@ export async function getAdditionalFiles(
         );
         if (existingContent) {
           logger.trace('Found lock file');
-          const lockFilePath = upath.join(localDir, filename);
+          const lockFilePath = upath.join(cloneDir, filename);
           logger.trace('Checking against ' + lockFilePath);
           try {
             let newContent: string;
diff --git a/lib/manager/nuget/artifacts.spec.ts b/lib/manager/nuget/artifacts.spec.ts
index 877d8de308..8df82c3612 100644
--- a/lib/manager/nuget/artifacts.spec.ts
+++ b/lib/manager/nuget/artifacts.spec.ts
@@ -35,7 +35,7 @@ const hostRules = mocked(_hostRules);
 
 const adminConfig: RepoAdminConfig = {
   // `join` fixes Windows CI
-  localDir: join('/tmp/github/some/repo'),
+  cloneDir: join('/tmp/github/some/repo'),
   cacheDir: join('/tmp/renovate/cache'),
 };
 
diff --git a/lib/manager/nuget/artifacts.ts b/lib/manager/nuget/artifacts.ts
index f36891f0d9..084be4141b 100644
--- a/lib/manager/nuget/artifacts.ts
+++ b/lib/manager/nuget/artifacts.ts
@@ -29,9 +29,9 @@ async function addSourceCmds(
   config: UpdateArtifactsConfig,
   nugetConfigFile: string
 ): Promise<string[]> {
-  const { localDir } = getAdminConfig();
+  const { cloneDir } = getAdminConfig();
   const registries =
-    (await getConfiguredRegistries(packageFileName, localDir)) ||
+    (await getConfiguredRegistries(packageFileName, cloneDir)) ||
     getDefaultRegistries();
   const result = [];
   for (const registry of registries) {
diff --git a/lib/manager/nuget/extract.spec.ts b/lib/manager/nuget/extract.spec.ts
index 95ac00b060..b6fb56aa76 100644
--- a/lib/manager/nuget/extract.spec.ts
+++ b/lib/manager/nuget/extract.spec.ts
@@ -8,7 +8,7 @@ import { extractPackageFile } from './extract';
 const config: ExtractConfig = {};
 
 const adminConfig: RepoAdminConfig = {
-  localDir: upath.resolve('lib/manager/nuget/__fixtures__'),
+  cloneDir: upath.resolve('lib/manager/nuget/__fixtures__'),
 };
 
 describe(getName(), () => {
diff --git a/lib/manager/nuget/extract.ts b/lib/manager/nuget/extract.ts
index 27a6ebecaf..0956aa48d1 100644
--- a/lib/manager/nuget/extract.ts
+++ b/lib/manager/nuget/extract.ts
@@ -71,8 +71,8 @@ export async function extractPackageFile(
 ): Promise<PackageFile | null> {
   logger.trace({ packageFile }, 'nuget.extractPackageFile()');
 
-  const { localDir } = getAdminConfig();
-  const registries = await getConfiguredRegistries(packageFile, localDir);
+  const { cloneDir } = getAdminConfig();
+  const registries = await getConfiguredRegistries(packageFile, cloneDir);
   const registryUrls = registries
     ? registries.map((registry) => registry.url)
     : undefined;
diff --git a/lib/manager/nuget/util.ts b/lib/manager/nuget/util.ts
index d7fcd54f03..894b22f9cb 100644
--- a/lib/manager/nuget/util.ts
+++ b/lib/manager/nuget/util.ts
@@ -32,12 +32,12 @@ export function getDefaultRegistries(): Registry[] {
 
 export async function getConfiguredRegistries(
   packageFile: string,
-  localDir: string
+  cloneDir: string
 ): Promise<Registry[] | undefined> {
   // Valid file names taken from https://github.com/NuGet/NuGet.Client/blob/f64621487c0b454eda4b98af853bf4a528bef72a/src/NuGet.Core/NuGet.Configuration/Settings/Settings.cs#L34
   const nuGetConfigFileNames = ['nuget.config', 'NuGet.config', 'NuGet.Config'];
   // normalize paths, otherwise startsWith can fail because of path delimitter mismatch
-  const normalizedLocalDir = upath.normalizeSafe(localDir);
+  const normalizedLocalDir = upath.normalizeSafe(cloneDir);
   const nuGetConfigPath = await findUp(nuGetConfigFileNames, {
     cwd: upath.dirname(upath.join(normalizedLocalDir, packageFile)),
     type: 'file',
diff --git a/lib/manager/pip_requirements/artifacts.spec.ts b/lib/manager/pip_requirements/artifacts.spec.ts
index 4cad75929c..f810010c1f 100644
--- a/lib/manager/pip_requirements/artifacts.spec.ts
+++ b/lib/manager/pip_requirements/artifacts.spec.ts
@@ -19,7 +19,7 @@ describe('.updateArtifacts()', () => {
   beforeEach(() => {
     jest.resetAllMocks();
     jest.resetModules();
-    setAdminConfig({ localDir: '' });
+    setAdminConfig({ cloneDir: '' });
   });
   it('returns null if no updatedDeps were provided', async () => {
     expect(
diff --git a/lib/manager/pip_setup/extract.spec.ts b/lib/manager/pip_setup/extract.spec.ts
index 37c254d32e..785904fca5 100644
--- a/lib/manager/pip_setup/extract.spec.ts
+++ b/lib/manager/pip_setup/extract.spec.ts
@@ -18,7 +18,7 @@ describe(getName(), () => {
     resetModule();
 
     env.getChildProcessEnv.mockReturnValue(envMock.basic);
-    setAdminConfig({ localDir: '/tmp/foo/bar' });
+    setAdminConfig({ cloneDir: '/tmp/foo/bar' });
   });
   describe('parsePythonVersion', () => {
     it('returns major and minor version numbers', () => {
diff --git a/lib/manager/pip_setup/index.spec.ts b/lib/manager/pip_setup/index.spec.ts
index fffa8ae536..7cfa11949f 100644
--- a/lib/manager/pip_setup/index.spec.ts
+++ b/lib/manager/pip_setup/index.spec.ts
@@ -20,7 +20,7 @@ const content = loadFixture(packageFile);
 const jsonContent = loadFixture('setup.py.json');
 
 const adminConfig: RepoAdminConfig = {
-  localDir: '/tmp/github/some/repo',
+  cloneDir: '/tmp/github/some/repo',
   cacheDir: '/tmp/renovate/cache',
 };
 
diff --git a/lib/manager/pipenv/artifacts.spec.ts b/lib/manager/pipenv/artifacts.spec.ts
index 64951dc94e..ebd24182aa 100644
--- a/lib/manager/pipenv/artifacts.spec.ts
+++ b/lib/manager/pipenv/artifacts.spec.ts
@@ -26,7 +26,7 @@ const env = mocked(_env);
 
 const adminConfig: RepoAdminConfig = {
   // `join` fixes Windows CI
-  localDir: join('/tmp/github/some/repo'),
+  cloneDir: join('/tmp/github/some/repo'),
   cacheDir: join('/tmp/renovate/cache'),
 };
 const dockerAdminConfig = { ...adminConfig, binarySource: BinarySource.Docker };
diff --git a/lib/manager/poetry/artifacts.spec.ts b/lib/manager/poetry/artifacts.spec.ts
index 85a77bc6cf..fd07cf0fc6 100644
--- a/lib/manager/poetry/artifacts.spec.ts
+++ b/lib/manager/poetry/artifacts.spec.ts
@@ -29,7 +29,7 @@ const datasource = mocked(_datasource);
 const hostRules = mocked(_hostRules);
 
 const adminConfig: RepoAdminConfig = {
-  localDir: join('/tmp/github/some/repo'),
+  cloneDir: join('/tmp/github/some/repo'),
 };
 
 const config: UpdateArtifactsConfig = {};
diff --git a/lib/util/exec/docker/index.ts b/lib/util/exec/docker/index.ts
index b58a9d82d3..17fd02288c 100644
--- a/lib/util/exec/docker/index.ts
+++ b/lib/util/exec/docker/index.ts
@@ -197,7 +197,7 @@ export async function generateDockerCommand(
   const preCommands = options.preCommands || [];
   const postCommands = options.postCommands || [];
   const {
-    localDir,
+    cloneDir,
     cacheDir,
     dockerUser,
     dockerChildPrefix,
@@ -212,7 +212,7 @@ export async function generateDockerCommand(
     result.push(`--user=${dockerUser}`);
   }
 
-  result.push(...prepareVolumes([localDir, cacheDir, ...volumes]));
+  result.push(...prepareVolumes([cloneDir, cacheDir, ...volumes]));
 
   if (envVars) {
     result.push(
diff --git a/lib/util/exec/exec.spec.ts b/lib/util/exec/exec.spec.ts
index b0b1c3cae3..26df36d406 100644
--- a/lib/util/exec/exec.spec.ts
+++ b/lib/util/exec/exec.spec.ts
@@ -717,7 +717,7 @@ describe(getName(), () => {
       callback(null, { stdout: '', stderr: '' });
       return undefined;
     });
-    setAdminConfig({ cacheDir, localDir: cwd, ...adminConfig });
+    setAdminConfig({ cacheDir, cloneDir: cwd, ...adminConfig });
     await exec(cmd as string, inOpts);
 
     expect(actualCmd).toEqual(outCommand);
diff --git a/lib/util/exec/index.ts b/lib/util/exec/index.ts
index a01b886e5e..ec2449455e 100644
--- a/lib/util/exec/index.ts
+++ b/lib/util/exec/index.ts
@@ -97,11 +97,11 @@ export async function exec(
   const extraEnv = { ...opts.extraEnv, ...customEnvVariables };
   let cwd;
   // istanbul ignore if
-  const { localDir } = getAdminConfig();
+  const { cloneDir } = getAdminConfig();
   if (cwdFile) {
-    cwd = join(localDir, dirname(cwdFile));
+    cwd = join(cloneDir, dirname(cwdFile));
   }
-  cwd = cwd || opts.cwd || localDir;
+  cwd = cwd || opts.cwd || cloneDir;
   const childEnv = createChildEnv(env, extraEnv);
 
   const execOptions: ExecOptions = { ...opts };
diff --git a/lib/util/fs/index.spec.ts b/lib/util/fs/index.spec.ts
index b8a05915e2..2d7571c55b 100644
--- a/lib/util/fs/index.spec.ts
+++ b/lib/util/fs/index.spec.ts
@@ -12,7 +12,7 @@ import {
 describe(getName(), () => {
   describe('readLocalFile', () => {
     beforeEach(() => {
-      setAdminConfig({ localDir: '' });
+      setAdminConfig({ cloneDir: '' });
     });
 
     it('reads buffer', async () => {
@@ -49,9 +49,9 @@ describe(getName(), () => {
   describe('findLocalSiblingOrParent', () => {
     it('returns path for file', async () => {
       await withDir(
-        async (localDir) => {
+        async (cloneDir) => {
           setAdminConfig({
-            localDir: localDir.path,
+            cloneDir: cloneDir.path,
           });
 
           await writeLocalFile('crates/one/Cargo.toml', '');
diff --git a/lib/util/fs/index.ts b/lib/util/fs/index.ts
index 71f4c42bf3..cbb8b88753 100644
--- a/lib/util/fs/index.ts
+++ b/lib/util/fs/index.ts
@@ -26,8 +26,8 @@ export async function readLocalFile(
   fileName: string,
   encoding?: string
 ): Promise<string | Buffer> {
-  const { localDir } = getAdminConfig();
-  const localFileName = join(localDir, fileName);
+  const { cloneDir } = getAdminConfig();
+  const localFileName = join(cloneDir, fileName);
   try {
     const fileContent = await fs.readFile(localFileName, encoding);
     return fileContent;
@@ -41,15 +41,15 @@ export async function writeLocalFile(
   fileName: string,
   fileContent: string
 ): Promise<void> {
-  const { localDir } = getAdminConfig();
-  const localFileName = join(localDir, fileName);
+  const { cloneDir } = getAdminConfig();
+  const localFileName = join(cloneDir, fileName);
   await fs.outputFile(localFileName, fileContent);
 }
 
 export async function deleteLocalFile(fileName: string): Promise<void> {
-  const { localDir } = getAdminConfig();
-  if (localDir) {
-    const localFileName = join(localDir, fileName);
+  const { cloneDir } = getAdminConfig();
+  if (cloneDir) {
+    const localFileName = join(cloneDir, fileName);
     await fs.remove(localFileName);
   }
 }
@@ -59,8 +59,8 @@ export async function renameLocalFile(
   fromFile: string,
   toFile: string
 ): Promise<void> {
-  const { localDir } = getAdminConfig();
-  await fs.move(join(localDir, fromFile), join(localDir, toFile));
+  const { cloneDir } = getAdminConfig();
+  await fs.move(join(cloneDir, fromFile), join(cloneDir, toFile));
 }
 
 // istanbul ignore next
@@ -70,8 +70,8 @@ export async function ensureDir(dirName: string): Promise<void> {
 
 // istanbul ignore next
 export async function ensureLocalDir(dirName: string): Promise<void> {
-  const { localDir } = getAdminConfig();
-  const localDirName = join(localDir, dirName);
+  const { cloneDir } = getAdminConfig();
+  const localDirName = join(cloneDir, dirName);
   await fs.ensureDir(localDirName);
 }
 
@@ -97,10 +97,10 @@ export function privateCacheDir(): string {
 }
 
 export function localPathExists(pathName: string): Promise<boolean> {
-  const { localDir } = getAdminConfig();
+  const { cloneDir } = getAdminConfig();
   // Works for both files as well as directories
   return fs
-    .stat(join(localDir, pathName))
+    .stat(join(cloneDir, pathName))
     .then((s) => !!s)
     .catch(() => false);
 }
@@ -109,7 +109,7 @@ export function localPathExists(pathName: string): Promise<boolean> {
  * Tries to find `otherFileName` in the directory where
  * `existingFileNameWithPath` is, then in its parent directory, then in the
  * grandparent, until we reach the top-level directory. All paths
- * must be relative to `localDir`.
+ * must be relative to `cloneDir`.
  */
 export async function findLocalSiblingOrParent(
   existingFileNameWithPath: string,
diff --git a/lib/util/git/index.spec.ts b/lib/util/git/index.spec.ts
index 4c7a231b94..159f8620a9 100644
--- a/lib/util/git/index.spec.ts
+++ b/lib/util/git/index.spec.ts
@@ -71,7 +71,7 @@ describe(getName(), () => {
     await repo.clone(base.path, '.', ['--bare']);
     await repo.addConfig('commit.gpgsign', 'false');
     tmpDir = await tmp.dir({ unsafeCleanup: true });
-    setAdminConfig({ localDir: tmpDir.path });
+    setAdminConfig({ cloneDir: tmpDir.path });
     await git.initRepo({
       url: origin.path,
       gitAuthorName: 'Jest',
diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts
index 1420f18a5c..6cf2c29825 100644
--- a/lib/util/git/index.ts
+++ b/lib/util/git/index.ts
@@ -175,8 +175,8 @@ export async function initRepo(args: StorageConfig): Promise<void> {
   config.ignoredAuthors = [];
   config.additionalBranches = [];
   config.branchIsModified = {};
-  const { localDir } = getAdminConfig();
-  git = Git(localDir);
+  const { cloneDir } = getAdminConfig();
+  git = Git(cloneDir);
   gitInitialized = false;
   await fetchBranchCommits();
 }
@@ -257,9 +257,9 @@ export async function syncGit(): Promise<void> {
     return;
   }
   gitInitialized = true;
-  const { localDir } = getAdminConfig();
-  logger.debug('Initializing git repository into ' + localDir);
-  const gitHead = join(localDir, '.git/HEAD');
+  const { cloneDir } = getAdminConfig();
+  logger.debug('Initializing git repository into ' + cloneDir);
+  const gitHead = join(cloneDir, '.git/HEAD');
   let clone = true;
 
   if (await fs.exists(gitHead)) {
@@ -283,7 +283,7 @@ export async function syncGit(): Promise<void> {
     }
   }
   if (clone) {
-    await fs.emptyDir(localDir);
+    await fs.emptyDir(cloneDir);
     const cloneStart = Date.now();
     try {
       // clone only the default branch
@@ -696,8 +696,8 @@ export async function commitFiles({
     await writePrivateKey();
     privateKeySet = true;
   }
-  const { localDir } = getAdminConfig();
-  await configSigningKey(localDir);
+  const { cloneDir } = getAdminConfig();
+  await configSigningKey(cloneDir);
   try {
     await git.reset(ResetMode.HARD);
     await git.raw(['clean', '-fd']);
@@ -708,7 +708,7 @@ export async function commitFiles({
       // istanbul ignore if
       if (file.name === '|delete|') {
         deleted.push(file.contents as string);
-      } else if (await isDirectory(join(localDir, file.name))) {
+      } else if (await isDirectory(join(cloneDir, file.name))) {
         fileNames.push(file.name);
         await gitAdd(file.name);
       } else {
@@ -720,7 +720,7 @@ export async function commitFiles({
         } else {
           contents = file.contents;
         }
-        await fs.outputFile(join(localDir, file.name), contents);
+        await fs.outputFile(join(cloneDir, file.name), contents);
       }
     }
     // istanbul ignore if
diff --git a/lib/workers/branch/execute-post-upgrade-commands.ts b/lib/workers/branch/execute-post-upgrade-commands.ts
index 9e67efc305..0cc6912055 100644
--- a/lib/workers/branch/execute-post-upgrade-commands.ts
+++ b/lib/workers/branch/execute-post-upgrade-commands.ts
@@ -62,7 +62,7 @@ export async function postUpgradeCommandsExecutor(
 
             logger.debug({ cmd: compiledCmd }, 'Executing post-upgrade task');
             const execResult = await exec(compiledCmd, {
-              cwd: getAdminConfig().localDir,
+              cwd: getAdminConfig().cloneDir,
             });
 
             logger.debug(
diff --git a/lib/workers/branch/index.spec.ts b/lib/workers/branch/index.spec.ts
index dc348e8214..c52528439d 100644
--- a/lib/workers/branch/index.spec.ts
+++ b/lib/workers/branch/index.spec.ts
@@ -63,7 +63,7 @@ const sanitize = mocked(_sanitize);
 const fs = mocked(_fs);
 const limits = mocked(_limits);
 
-const adminConfig: RepoAdminConfig = { localDir: '', cacheDir: '' };
+const adminConfig: RepoAdminConfig = { cloneDir: '', cacheDir: '' };
 
 describe(getName(), () => {
   describe('processBranch', () => {
@@ -781,7 +781,7 @@ describe(getName(), () => {
         allowedPostUpgradeCommands: ['^echo {{{versioning}}}$'],
         allowPostUpgradeCommandTemplating: true,
         exposeAllEnv: true,
-        localDir: '/localDir',
+        cloneDir: '/cloneDir',
       });
 
       const result = await branchWorker.processBranch({
@@ -806,7 +806,7 @@ describe(getName(), () => {
 
       expect(result).toMatchSnapshot();
       expect(exec.exec).toHaveBeenCalledWith('echo semver', {
-        cwd: '/localDir',
+        cwd: '/cloneDir',
       });
       const errorMessage = expect.stringContaining(
         "Post-upgrade command 'disallowed task' does not match allowed pattern '^echo {{{versioning}}}$'"
@@ -861,7 +861,7 @@ describe(getName(), () => {
         allowedPostUpgradeCommands: ['^exit 1$'],
         allowPostUpgradeCommandTemplating: true,
         exposeAllEnv: true,
-        localDir: '/localDir',
+        cloneDir: '/cloneDir',
       });
 
       exec.exec.mockRejectedValue(new Error('Meh, this went wrong!'));
@@ -930,7 +930,7 @@ describe(getName(), () => {
         allowedPostUpgradeCommands: ['^echo {{{versioning}}}$'],
         allowPostUpgradeCommandTemplating: false,
         exposeAllEnv: true,
-        localDir: '/localDir',
+        cloneDir: '/cloneDir',
       });
       const result = await branchWorker.processBranch({
         ...config,
@@ -954,7 +954,7 @@ describe(getName(), () => {
 
       expect(result).toMatchSnapshot();
       expect(exec.exec).toHaveBeenCalledWith('echo {{{versioning}}}', {
-        cwd: '/localDir',
+        cwd: '/cloneDir',
       });
     });
 
@@ -1010,7 +1010,7 @@ describe(getName(), () => {
         allowedPostUpgradeCommands: ['^echo {{{depName}}}$'],
         allowPostUpgradeCommandTemplating: true,
         exposeAllEnv: true,
-        localDir: '/localDir',
+        cloneDir: '/cloneDir',
       });
 
       const inconfig: BranchConfig = {
@@ -1061,10 +1061,10 @@ describe(getName(), () => {
 
       expect(result).toMatchSnapshot();
       expect(exec.exec).toHaveBeenNthCalledWith(1, 'echo some-dep-name-1', {
-        cwd: '/localDir',
+        cwd: '/cloneDir',
       });
       expect(exec.exec).toHaveBeenNthCalledWith(2, 'echo some-dep-name-2', {
-        cwd: '/localDir',
+        cwd: '/cloneDir',
       });
       expect(exec.exec).toHaveBeenCalledTimes(2);
       expect(
@@ -1144,7 +1144,7 @@ describe(getName(), () => {
         allowedPostUpgradeCommands: ['^echo hardcoded-string$'],
         allowPostUpgradeCommandTemplating: true,
         trustLevel: 'high',
-        localDir: '/localDir',
+        cloneDir: '/cloneDir',
       });
 
       const inconfig: BranchConfig = {
@@ -1194,7 +1194,7 @@ describe(getName(), () => {
       const result = await branchWorker.processBranch(inconfig);
       expect(result).toMatchSnapshot();
       expect(exec.exec).toHaveBeenNthCalledWith(1, 'echo hardcoded-string', {
-        cwd: '/localDir',
+        cwd: '/cloneDir',
       });
       expect(exec.exec).toHaveBeenCalledTimes(1);
       expect(
diff --git a/lib/workers/branch/lock-files/index.spec.ts b/lib/workers/branch/lock-files/index.spec.ts
index 947caf80d6..e232126270 100644
--- a/lib/workers/branch/lock-files/index.spec.ts
+++ b/lib/workers/branch/lock-files/index.spec.ts
@@ -32,7 +32,7 @@ describe(getName(), () => {
   describe('writeUpdatedPackageFiles', () => {
     beforeEach(() => {
       setAdminConfig({
-        localDir: 'some-tmp-dir',
+        cloneDir: 'some-tmp-dir',
       });
       fs.outputFile = jest.fn();
     });
@@ -71,7 +71,7 @@ describe(getName(), () => {
   describe('getAdditionalFiles', () => {
     beforeEach(() => {
       setAdminConfig({
-        localDir: 'some-tmp-dir',
+        cloneDir: 'some-tmp-dir',
       });
       git.getFile.mockResolvedValueOnce('some lock file contents');
       npm.generateLockFile = jest.fn();
diff --git a/lib/workers/global/index.ts b/lib/workers/global/index.ts
index 6d096d4f8c..06ee3438db 100644
--- a/lib/workers/global/index.ts
+++ b/lib/workers/global/index.ts
@@ -29,11 +29,11 @@ export async function getRepositoryConfig(
     globalConfig,
     is.string(repository) ? { repository } : repository
   );
-  repoConfig.localDir = upath.join(
+  repoConfig.cloneDir = upath.join(
     repoConfig.baseDir,
     `./repos/${repoConfig.platform}/${repoConfig.repository}`
   );
-  await fs.ensureDir(repoConfig.localDir);
+  await fs.ensureDir(repoConfig.cloneDir);
   delete repoConfig.baseDir;
   return configParser.filterConfig(repoConfig, 'repository');
 }
diff --git a/lib/workers/repository/index.spec.ts b/lib/workers/repository/index.spec.ts
index cbc9cd3d54..78335894b8 100644
--- a/lib/workers/repository/index.spec.ts
+++ b/lib/workers/repository/index.spec.ts
@@ -18,7 +18,7 @@ describe(getName(), () => {
     let config: RenovateConfig;
     beforeEach(() => {
       config = getConfig();
-      setAdminConfig({ localDir: '' });
+      setAdminConfig({ cloneDir: '' });
     });
     it('runs', async () => {
       process.extractDependencies.mockResolvedValue(mock<ExtractResult>());
diff --git a/lib/workers/repository/index.ts b/lib/workers/repository/index.ts
index ecce455412..6112835728 100644
--- a/lib/workers/repository/index.ts
+++ b/lib/workers/repository/index.ts
@@ -34,10 +34,10 @@ export async function renovateRepository(
   logger.trace({ config });
   let repoResult: ProcessResult;
   queue.clear();
-  const { localDir } = getAdminConfig();
+  const { cloneDir } = getAdminConfig();
   try {
-    await fs.ensureDir(localDir);
-    logger.debug('Using localDir: ' + localDir);
+    await fs.ensureDir(cloneDir);
+    logger.debug('Using cloneDir: ' + cloneDir);
     config = await initRepo(config);
     addSplit('init');
     const { branches, branchList, packageFiles } = await extractDependencies(
@@ -57,11 +57,11 @@ export async function renovateRepository(
     const errorRes = await handleError(config, err);
     repoResult = processResult(config, errorRes);
   }
-  if (localDir && !config.persistRepoData) {
+  if (cloneDir && !config.persistRepoData) {
     try {
       await deleteLocalFile('.');
     } catch (err) /* istanbul ignore if */ {
-      logger.warn({ err }, 'localDir deletion error');
+      logger.warn({ err }, 'cloneDir deletion error');
     }
   }
   try {
diff --git a/lib/workers/repository/init/index.spec.ts b/lib/workers/repository/init/index.spec.ts
index b453a079a3..8e34aac67f 100644
--- a/lib/workers/repository/init/index.spec.ts
+++ b/lib/workers/repository/init/index.spec.ts
@@ -24,7 +24,7 @@ const secrets = mocked(_secrets);
 
 describe(getName(), () => {
   beforeEach(() => {
-    setAdminConfig({ localDir: '', cacheDir: '' });
+    setAdminConfig({ cloneDir: '', cacheDir: '' });
   });
   afterEach(() => {
     setAdminConfig();
-- 
GitLab