瀏覽代碼

Fixes new files not showing a diff

main
Keith Daulton 2 年之前
父節點
當前提交
4ce3a8f66b
共有 2 個文件被更改,包括 12 次插入1 次删除
  1. +10
    -1
      src/commands/gitCommands.actions.ts
  2. +2
    -0
      src/webviews/apps/commitDetails/commitDetails.ts

+ 10
- 1
src/commands/gitCommands.actions.ts 查看文件

@ -3,6 +3,7 @@ import { env, Range, Uri, window } from 'vscode';
import type {
BrowseRepoAtRevisionCommandArgs,
DiffWithCommandArgs,
DiffWithPreviousCommandArgs,
DiffWithWorkingCommandArgs,
GitCommandsCommandArgs,
OpenFileOnRemoteCommandArgs,
@ -371,7 +372,15 @@ export namespace GitActions {
file = f;
}
if (file.status === 'A') return;
if (file.status === 'A') {
if (!isCommit(commitOrRefs)) return;
const commit = await commitOrRefs.getCommitForFile(file);
void executeCommand<DiffWithPreviousCommandArgs>(Commands.DiffWithPrevious, {
commit: commit,
showOptions: options,
});
}
const refs = isCommit(commitOrRefs)
? {

+ 2
- 0
src/webviews/apps/commitDetails/commitDetails.ts 查看文件

@ -382,6 +382,7 @@ export class CommitDetailsApp extends App> {
level="${level}"
${stashAttr}
path="${item.value.path}"
repo="${item.value.repoPath}"
icon="${item.value.icon.dark}"
status="${item.value.status}"
></file-change-list-item>
@ -400,6 +401,7 @@ export class CommitDetailsApp extends App> {
<file-change-list-item
${stashAttr}
path="${file.path}"
repo="${file.repoPath}"
icon="${file.icon.dark}"
status="${file.status}"
></file-change-list-item>

Loading…
取消
儲存