提交 37de7e18 编写于 作者: J Joao Moreno

git: cleanup tag

上级 0bd753f8
......@@ -192,11 +192,6 @@
"title": "%command.createTag%",
"category": "Git"
},
{
"command": "git.showTags",
"title": "%command.showTags%",
"category": "Git"
},
{
"command": "git.pull",
"title": "%command.pull%",
......@@ -362,10 +357,6 @@
"command": "git.pullFrom",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.showTags",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.createTag",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
......
......@@ -25,7 +25,6 @@
"command.deleteBranch": "Delete Branch...",
"command.merge": "Merge Branch...",
"command.createTag": "Create Tag",
"command.showTags": "Show Tags",
"command.pull": "Pull",
"command.pullRebase": "Pull (Rebase)",
"command.pullFrom": "Pull from...",
......
......@@ -851,15 +851,13 @@ export class CommandCenter {
const inputMessage = await window.showInputBox({
placeHolder: localize('tag message', "Message"),
prompt: localize('provide tag message', "Please provide a message"),
prompt: localize('provide tag message', "Please provide a message to annotate the tag"),
ignoreFocusOut: true
});
const name = inputTagName.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$/g, '-');
const message = inputMessage || name;
await this.model.tag(name, message);
window.showInformationMessage(localize('tag creation success', "Successfully created tag."));
}
@command('git.pullFrom')
......
......@@ -677,13 +677,13 @@ export class Repository {
}
}
async tag(name: string, message: string, lightweight: boolean): Promise<void> {
async tag(name: string, message?: string): Promise<void> {
let args = ['tag'];
if (lightweight) {
args.push(name);
if (message) {
args = [...args, '-a', name, '-m', message];
} else {
args = args.concat(['-a', name, '-m', message]);
args = [...args, name];
}
await this.run(args);
......
......@@ -466,8 +466,8 @@ export class Model implements Disposable {
await this.run(Operation.Merge, () => this.repository.merge(ref));
}
async tag(name: string, message: string): Promise<void> {
await this.run(Operation.Tag, () => this.repository.tag(name, message, false));
async tag(name: string, message?: string): Promise<void> {
await this.run(Operation.Tag, () => this.repository.tag(name, message));
}
async checkout(treeish: string): Promise<void> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册