提交 351905fd 编写于 作者: J Joao Moreno

fixes #63957

上级 d0c114cd
......@@ -496,6 +496,7 @@ export class CommandCenter {
@command('git.init')
async init(): Promise<void> {
let repositoryPath: string | undefined = undefined;
let askToOpen = true;
if (workspace.workspaceFolders) {
const placeHolder = localize('init', "Pick workspace folder to initialize git repo in");
......@@ -510,6 +511,7 @@ export class CommandCenter {
return;
} else if (item.folder) {
repositoryPath = item.folder.uri.fsPath;
askToOpen = false;
}
}
......@@ -543,6 +545,10 @@ export class CommandCenter {
}
repositoryPath = uri.fsPath;
if (workspace.workspaceFolders && workspace.workspaceFolders.some(w => w.uri.toString() === uri.toString())) {
askToOpen = false;
}
}
await this.git.init(repositoryPath);
......@@ -552,6 +558,10 @@ export class CommandCenter {
const open = localize('openrepo', "Open Repository");
choices.push(open);
if (!askToOpen) {
return;
}
const addToWorkspace = localize('add', "Add to Workspace");
if (workspace.workspaceFolders) {
message = localize('proposeopen2 init', "Would you like to open the initialized repository, or add it to the current workspace?");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册