Code change:
url = url.trim().replace(/^gits+clones+/, ''); <del> const config = workspace.getConfiguration('git'); let defaultCloneDirectory = config.get<string>('defaultCloneDirectory') || os.homedir(); defaultCloneDirectory = defaultCloneDirectory.replace(/^~/, os.homedir()); const uris = await window.showOpenDialog({ canSelectFiles: false, canSelectFolders: true, canSelectMany: false, defaultUri: Uri.file(defaultCloneDirectory), openLabel: localize('selectFolder', "Select Repository Location") }); </del> <ins> if (!parentPath) { const config = workspace.getConfiguration('git'); let defaultCloneDirectory = config.get<string>('defaultCloneDirectory') || os.homedir(); defaultCloneDirectory = defaultCloneDirectory.replace(/^~/, os.homedir()); </ins> <del> if (!uris || uris.length === 0) { /* __GDPR__ "clone" : { "outcome" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } } */ this.telemetryReporter.sendTelemetryEvent('clone', { outcome: 'no_directory' }); return; } </del> <ins> const uris = await window.showOpenDialog({ canSelectFiles: false, canSelectFolders: true, canSelectMany: false, defaultUri: Uri.file(defaultCloneDirectory), openLabel: localize('selectFolder', "Select Repository Location") }); </ins> <del> const uri = uris[0]; const parentPath = uri.fsPath; </del> <ins> if (!uris || uris.length === 0) { /* __GDPR__ "clone" : { "outcome" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } } */ this.telemetryReporter.sendTelemetryEvent('clone', { outcome: 'no_directory' }); return; } const uri = uris[0]; parentPath = uri.fsPath; } </ins> try { const opts = {

Related discussion:
text: <!-- Please search existing issues to avoid creating duplicates. --<!-- Describe the feature you'd like. --I'm working on a Visual Studio Code extension that's supposed to make it easier to clone a git repository in a user configured directory. The basic idea is that the user configures the directory once (e.g.: in ) and then all the cloned repositories will be placed in this directory. The seems the ideal candidate for implementing something like this (especially now with the new ). However, the only problem is that the command is always asking the user for the destination directory. This feature request is about adding an option to the command which would allow other extensions to clone a repository in a specific directory without showing the dialog. One possible implementation could be as simple as adding another optional argument (for the destination directory) to the command ().
Found a quirk:
Fixing the quirk is fine in the future. Thus pushing it out to the On Deck milestone since Joao is on vacation. please speak up if you disagree.
+1 for this issue. I'm also working on a VS Code extension (specifically the C++ extension here in Redmond). We're working on an experience that involves operating on the files in a repository that the user has cloned via the command, but currently there is no way to know which parent directory was selected. Allowing the repository parent directory to be passed in would solve the problem entirely for us -- I'll be watching this issue closely. :slightlysmilingface:
This has been implemented () and you can already use it in Visual Studio Code version .
Thanks
Since this is already implemented I am closign this issue. Thanks As for the quirk can handle as an independet issue
should this issue be labelled with again? I also wonder if the quirk has been filed as a separate issue.