Browse Source

Adds keep-index if no uris are staged

main
Eric Amodio 5 years ago
parent
commit
6cb5ec8c56
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      src/commands/stashSave.ts

+ 11
- 0
src/commands/stashSave.ts View File

@ -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…
Cancel
Save