diff --git a/extensions/git/package.json b/extensions/git/package.json index b06bb33a1dbdd26f9e0c7171259e1f52c0704e7c..749b3a65c09613ff4d166a5084520a9bc357bc42 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -618,6 +618,11 @@ "type": "boolean", "description": "%config.ignoreLegacyWarning%", "default": false + }, + "git.cloneDirectory": { + "type": "string", + "default": null, + "description": "%config.cloneDirectory%" } } } diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index 1db12e4a6b0a66cdabb353258ed52743c8241373..44eb8b422c3ab890dd1e4f7c8455bcb7ca506f8c 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -36,5 +36,6 @@ "config.confirmSync": "Confirm before synchronizing git repositories", "config.countBadge": "Controls the git badge counter", "config.checkoutType": "Controls what type of branches are listed", - "config.ignoreLegacyWarning": "Ignores the legacy Git warning" + "config.ignoreLegacyWarning": "Ignores the legacy Git warning", + "config.cloneDirectory": "When cloning a new repository, the default location will be set to this directory" } \ No newline at end of file diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index eeccf86f2dcd4fc3b2be20e0b8fe2401fea3efaf..61a519a66b82fd030a36983d10aa645a53c31aa2 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -202,9 +202,12 @@ export class CommandCenter { return; } + const config = workspace.getConfiguration('git'); + const cloneDirectory = config.get('cloneDirectory') || os.homedir(); + const parentPath = await window.showInputBox({ prompt: localize('parent', "Parent Directory"), - value: os.homedir(), + value: cloneDirectory, ignoreFocusOut: true }); diff --git a/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts b/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts index e35495db43325cf565ecb4081270db988095511a..0bdf195f96c11964c1ef8d91a16914f8f06bd2a9 100644 --- a/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts +++ b/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts @@ -235,6 +235,11 @@ export function registerContributions(): void { enum: ['all', 'local', 'tags', 'remote'], default: 'all', description: nls.localize('checkoutType', "Controls what type of branches are listed."), + }, + 'git.cloneDirectory': { + type: 'string', + default: null, + description: nls.localize('cloneDirectory', "When cloning a new repository, the default location will be set to this directory."), } } });