From f19aa21df8833fafbe4bdd2c72db88f4b66cf687 Mon Sep 17 00:00:00 2001 From: Ilie Halip Date: Tue, 18 Apr 2017 15:26:28 +0300 Subject: [PATCH] added config option git.cloneDirectory, defaulting to os.homedir() --- extensions/git/package.json | 5 +++++ extensions/git/package.nls.json | 3 ++- extensions/git/src/commands.ts | 5 ++++- .../workbench/parts/git/browser/gitWorkbenchContributions.ts | 5 +++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/extensions/git/package.json b/extensions/git/package.json index b06bb33a1dbdd..749b3a65c0961 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 1db12e4a6b0a6..44eb8b422c3ab 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 eeccf86f2dcd4..61a519a66b82f 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 e35495db43325..0bdf195f96c11 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."), } } });