Skip to content

Commit d8654c6

Browse files
committed
Fixes show more actions button on hover w/ renames
1 parent 318f769 commit d8654c6

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
88

99
## Fixed
1010

11+
- Fixes issues with the _Show More Actions_ button on the _Details_ hover not working with renamed files
1112
- Fixes issues with the _Open File_, _Open Files_, _Open All Changes with Working Tree_, and _Apply Changes_ commands in the views not working with renamed files
1213
- Fixes issues with the _Open File_, _Open Files_, and _Apply Changes_ command in the quick pick menus not working with renamed files
1314
- Fixes issues with the _Show Stashed Changes_ (`gitlens.showQuickStashList`) command and multiple repositories

src/commands/showQuickCommitFileDetails.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,14 @@ export interface ShowQuickCommitFileDetailsCommandArgs {
2222
sha?: string;
2323
commit?: GitCommit | GitLogCommit;
2424
fileLog?: GitLog;
25+
revisionUri?: string;
2526

2627
goBackCommand?: CommandQuickPickItem;
2728
}
2829

2930
@command()
3031
export class ShowQuickCommitFileDetailsCommand extends ActiveEditorCachedCommand {
31-
static getMarkdownCommandArgs(sha: string): string;
32-
static getMarkdownCommandArgs(args: ShowQuickCommitFileDetailsCommandArgs): string;
33-
static getMarkdownCommandArgs(argsOrSha: ShowQuickCommitFileDetailsCommandArgs | string): string {
34-
const args = typeof argsOrSha === 'string' ? { sha: argsOrSha } : argsOrSha;
32+
static getMarkdownCommandArgs(args: ShowQuickCommitFileDetailsCommandArgs): string {
3533
return super.getMarkdownCommandArgsCore<ShowQuickCommitFileDetailsCommandArgs>(
3634
Commands.ShowQuickCommitFileDetails,
3735
args
@@ -66,7 +64,14 @@ export class ShowQuickCommitFileDetailsCommand extends ActiveEditorCachedCommand
6664
uri = getCommandUri(uri, editor);
6765
if (uri == null) return undefined;
6866

69-
const gitUri = await GitUri.fromUri(uri);
67+
let gitUri;
68+
if (args.revisionUri !== undefined) {
69+
gitUri = GitUri.fromRevisionUri(Uri.parse(args.revisionUri));
70+
args.sha = gitUri.sha;
71+
}
72+
else {
73+
gitUri = await GitUri.fromUri(uri);
74+
}
7075

7176
args = { ...args };
7277
if (args.sha === undefined) {

src/git/formatters/commitFormatter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ export class CommitFormatter extends Formatter<GitCommit, CommitFormatOptions> {
245245
}
246246
}
247247

248-
commands += `[\`${GlyphChars.MiddleEllipsis}\`](${ShowQuickCommitFileDetailsCommand.getMarkdownCommandArgs(
249-
this._item.sha
250-
)} "Show More Actions")`;
248+
commands += `[\`${GlyphChars.MiddleEllipsis}\`](${ShowQuickCommitFileDetailsCommand.getMarkdownCommandArgs({
249+
revisionUri: GitUri.toRevisionUri(this._item.toGitUri()).toString(true)
250+
})} "Show More Actions")`;
251251

252252
return commands;
253253
}

0 commit comments

Comments
 (0)