Bladeren bron

Fixes #2527 shows added files for Open All Changes

main
Keith Daulton 1 jaar geleden
committed by Keith Daulton
bovenliggende
commit
af24943a41
1 gewijzigde bestanden met toevoegingen van 7 en 5 verwijderingen
  1. +7
    -5
      src/git/actions/commit.ts

+ 7
- 5
src/git/actions/commit.ts Bestand weergeven

@ -202,8 +202,10 @@ export async function openChanges(
commitOrRefs: GitCommit | { repoPath: string; ref1: string; ref2: string },
options?: TextDocumentShowOptions,
) {
const isArgCommit = isCommit(commitOrRefs);
if (typeof file === 'string') {
if (!isCommit(commitOrRefs)) throw new Error('Invalid arguments');
if (!isArgCommit) throw new Error('Invalid arguments');
const f = await commitOrRefs.findFile(file);
if (f == null) throw new Error('Invalid arguments');
@ -213,17 +215,17 @@ export async function openChanges(
options = { preserveFocus: true, preview: false, ...options };
if (file.status === 'A') {
if (!isCommit(commitOrRefs)) return;
if (file.status === 'A' && isArgCommit) {
const commit = await commitOrRefs.getCommitForFile(file);
void executeCommand<DiffWithPreviousCommandArgs>(Commands.DiffWithPrevious, {
commit: commit,
showOptions: options,
});
return;
}
const refs = isCommit(commitOrRefs)
const refs = isArgCommit
? {
repoPath: commitOrRefs.repoPath,
// Don't need to worry about verifying the previous sha, as the DiffWith command will

Laden…
Annuleren
Opslaan