Browse Source

Fixes opening stash details from view

main
Eric Amodio 1 year ago
parent
commit
f90ae3a85d
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      src/commands/showCommitsInView.ts

+ 6
- 3
src/commands/showCommitsInView.ts View File

@ -4,7 +4,8 @@ import type { Container } from '../container';
import { executeGitCommand } from '../git/actions';
import { showDetailsView } from '../git/actions/commit';
import { GitUri } from '../git/gitUri';
import { createReference } from '../git/models/reference';
import type { GitRevisionReference } from '../git/models/reference';
import { createReference, getReferenceFromRevision } from '../git/models/reference';
import { createSearchQueryForCommits } from '../git/search';
import { showFileNotUnderSourceControlWarningMessage, showGenericErrorMessage } from '../messages';
import { command } from '../system/command';
@ -14,6 +15,7 @@ import type { CommandContext } from './base';
import { ActiveEditorCommand, getCommandUri, isCommandContextViewNodeHasCommit } from './base';
export interface ShowCommitsInViewCommandArgs {
ref?: GitRevisionReference;
refs?: string[];
repoPath?: string;
}
@ -35,8 +37,7 @@ export class ShowCommitsInViewCommand extends ActiveEditorCommand {
if (context.type === 'viewItem') {
args = { ...args };
if (isCommandContextViewNodeHasCommit(context)) {
args.refs = [context.node.commit.sha];
args.repoPath = context.node.commit.repoPath;
args.ref = getReferenceFromRevision(context.node.commit);
}
}
@ -46,6 +47,8 @@ export class ShowCommitsInViewCommand extends ActiveEditorCommand {
async execute(editor?: TextEditor, uri?: Uri, args?: ShowCommitsInViewCommandArgs) {
args = { ...args };
if (args.ref != null) return showDetailsView(args.ref);
if (args.refs === undefined) {
uri = getCommandUri(uri, editor);
if (uri == null) return undefined;

||||||
x
 
000:0
Loading…
Cancel
Save