提交 c3c4f5e8 编写于 作者: J Joao Moreno

💄

上级 12c41aa9
......@@ -1432,23 +1432,7 @@ export class CommandCenter {
await this.runByRepository(resources, async (repository, resources) => repository.ignore(resources));
}
@command('git.stashIncludeUntracked', { repository: true })
async stashIncludeUntracked(repository: Repository): Promise<void> {
if (repository.workingTreeGroup.resourceStates.length === 0) {
window.showInformationMessage(localize('no changes stash', "There are no changes to stash."));
return;
}
const message = await this.getStashMessage();
if (typeof message === 'undefined') {
return;
}
await repository.createStash(message, true);
}
@command('git.stash', { repository: true })
async stash(repository: Repository): Promise<void> {
private async _stash(repository: Repository, includeUntracked = false): Promise<void> {
if (repository.workingTreeGroup.resourceStates.length === 0) {
window.showInformationMessage(localize('no changes stash', "There are no changes to stash."));
return;
......@@ -1460,7 +1444,7 @@ export class CommandCenter {
return;
}
await repository.createStash(message);
await repository.createStash(message, includeUntracked);
}
private async getStashMessage(): Promise<string | undefined> {
......@@ -1470,6 +1454,16 @@ export class CommandCenter {
});
}
@command('git.stash', { repository: true })
stash(repository: Repository): Promise<void> {
return this._stash(repository);
}
@command('git.stashIncludeUntracked', { repository: true })
stashIncludeUntracked(repository: Repository): Promise<void> {
return this._stash(repository, true);
}
@command('git.stashPop', { repository: true })
async stashPop(repository: Repository): Promise<void> {
const stashes = await repository.getStashes();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册