瀏覽代碼

Adds keep-index if no uris are staged

main
Eric Amodio 5 年之前
父節點
當前提交
6cb5ec8c56
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. +11
    -0
      src/commands/stashSave.ts

+ 11
- 0
src/commands/stashSave.ts 查看文件

@ -14,6 +14,12 @@ import {
} from './common';
import { GitCommandsCommandArgs } from '../commands';
const enum ResourceGroupType {
Merge,
Index,
WorkingTree
}
export interface StashSaveCommandArgs {
message?: string;
repoPath?: string;
@ -42,6 +48,11 @@ export class StashSaveCommand extends Command {
args.repoPath = context.node.repoPath;
} else if (context.type === 'scm-states') {
args = { ...args };
if (!context.scmResourceStates.some(s => (s as any).resourceGroupType === ResourceGroupType.Index)) {
args.keepStaged = true;
}
args.uris = context.scmResourceStates.map(s => s.resourceUri);
} else if (context.type === 'scm-groups') {
args = { ...args };

Loading…
取消
儲存