diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts old mode 100644 new mode 100755 index 10d32de5984..118f35f03ea --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -512,6 +512,22 @@ export class CommandCenter { await this.git.init(path); await this.model.openRepository(path); + + const choices = []; + let message = localize('proposeopeninitialisedrepo', "Would you like to add the repository folder to workspace?"); + const open = localize('addinitrepo', "Add folder"); + const notopen = localize('notaddinitrepo', "No, don't add"); + choices.push(open); + choices.push(notopen); + + const result = await window.showInformationMessage(message, ...choices); + const openFolder = result === open; + + if(openFolder) + { + const uri = Uri.file(path); + workspace.updateWorkspaceFolders(workspace.workspaceFolders ? workspace.workspaceFolders.length : 0, null, { uri}); + } } @command('git.openRepository', { repository: false })