소스 검색

Closes #698 - keeps index if not stashing staged

main
Eric Amodio 5 년 전
부모
커밋
c8a3cc9494
2개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -0
      CHANGELOG.md
  2. +8
    -1
      src/commands/stashSave.ts

+ 1
- 0
CHANGELOG.md 파일 보기

@ -41,6 +41,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Changes the _Reset to Commit (via Terminal)_ command to use the _reset_ Git command
- Changes the _Revert Commit (via Terminal)_ command to use the _revert_ Git command
- Changes all the stash commands to use the new _stash_ Git command
- Changes _Stash All Changes_ commands in the Source Control view to toggle --kee-index appropriately — closes [#698](https://github.com/eamodio/vscode-gitlens/issues/698)
- Changes the _Checkout_ command on branches, commits, and tags to use the _switch_ Git command
- Changes Ansible files to use document scope for code lens — thanks to [PR #813](https://github.com/eamodio/vscode-gitlens/pull/813) by Ahmadali Shafiee ([@ahmadalli](https://github.com/ahmadalli))
- Renames _Checkout_ command to _Switch_ for branches and tags for better clarity and to align with the new Git 2.23 commands

+ 8
- 1
src/commands/stashSave.ts 파일 보기

@ -18,6 +18,7 @@ export interface StashSaveCommandArgs {
message?: string;
repoPath?: string;
uris?: Uri[];
keepStaged?: boolean;
goBackCommand?: CommandQuickPickItem;
}
@ -44,6 +45,11 @@ export class StashSaveCommand extends Command {
args.uris = context.scmResourceStates.map(s => s.resourceUri);
} else if (context.type === 'scm-groups') {
args = { ...args };
if (!context.scmResourceGroups.some(g => g.id === 'index')) {
args.keepStaged = true;
}
args.uris = context.scmResourceGroups.reduce<Uri[]>(
(a, b) => a.concat(b.resourceStates.map(s => s.resourceUri)),
[]
@ -65,7 +71,8 @@ export class StashSaveCommand extends Command {
subcommand: 'push',
repo: repo,
message: args.message,
uris: args.uris
uris: args.uris,
flags: args.keepStaged ? ['--keep-index'] : undefined
}
};
return commands.executeCommand(Commands.GitCommands, gitCommandArgs);

불러오는 중...
취소
저장