Skip to content

Commit 75a313f

Browse files
committed
Fixes #4060 invalid raf names
1 parent eb33e8a commit 75a313f

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

CHANGELOG.md

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

99
### Fixed
1010

11-
- Fixes [#3841](https://github.com/gitkraken/vscode-gitlens/issues/3841) - Inspect & Graph Details: autolinks rendering when enabled setting is false
11+
- Fixes Inspect & Graph Details: autolinks rendering when enabled setting is false ([#3841](https://github.com/gitkraken/vscode-gitlens/issues/3841))
12+
- Fixes comparison with Merge Target on Home fails to open a valid comparison ([#4060](https://github.com/gitkraken/vscode-gitlens/issues/4060))
1213

1314
## [16.3.0] - 2025-02-11
1415

src/webviews/apps/plus/home/components/merge-target-status.ts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { css, html, LitElement, nothing } from 'lit';
22
import { customElement, property, state } from 'lit/decorators.js';
33
import { createCommandLink } from '../../../../../system/commands';
44
import { pluralize } from '../../../../../system/string';
5-
import type { BranchRef, GetOverviewBranch } from '../../../../home/protocol';
5+
import type { BranchAndTargetRefs, BranchRef, GetOverviewBranch } from '../../../../home/protocol';
66
import { renderBranchName } from '../../../shared/components/branch-name';
77
import { elementBase, linkBase, scrollableBase } from '../../../shared/components/styles/lit/base.css';
88
import { chipStyles } from '../../shared/components/chipStyles';
@@ -414,19 +414,27 @@ export class GlMergeTargetStatus extends LitElement {
414414
}
415415

416416
private renderActions() {
417+
const branchRef = this.branchRef;
418+
const targetRef = this.targetBranchRef;
419+
417420
return html`<span class="header__actions"
418-
><gl-button
419-
href="${createCommandLink('gitlens.home.openMergeTargetComparison', {
420-
...this.branchRef,
421-
mergeTargetId: this.targetBranchRef?.branchId,
422-
})}"
421+
>${branchRef && targetRef
422+
? html`<gl-button
423+
href="${createCommandLink<BranchAndTargetRefs>('gitlens.home.openMergeTargetComparison', {
424+
...branchRef,
425+
mergeTargetId: targetRef.branchId,
426+
mergeTargetName: targetRef.branchName,
427+
})}"
428+
appearance="toolbar"
429+
><code-icon icon="git-compare"></code-icon>
430+
<span slot="tooltip"
431+
>Compare Branch with Merge Target<br />${renderBranchName(this.branch.name)}
432+
&leftrightarrow; ${renderBranchName(this.target?.name)}</span
433+
>
434+
</gl-button>`
435+
: nothing}<gl-button
436+
href="${createCommandLink('gitlens.home.fetch', this.targetBranchRef)}"
423437
appearance="toolbar"
424-
><code-icon icon="git-compare"></code-icon>
425-
<span slot="tooltip"
426-
>Compare Branch with Merge Target<br />${renderBranchName(this.branch.name)} &leftrightarrow;
427-
${renderBranchName(this.target?.name)}</span
428-
> </gl-button
429-
><gl-button href="${createCommandLink('gitlens.home.fetch', this.targetBranchRef)}" appearance="toolbar"
430438
><code-icon icon="repo-fetch"></code-icon>
431439
<span slot="tooltip">Fetch Merge Target<br />${renderBranchName(this.target?.name)}</span>
432440
</gl-button></span

src/webviews/home/homeWebview.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import type { IpcMessage } from '../protocol';
6868
import type { WebviewHost, WebviewProvider, WebviewShowingArgs } from '../webviewProvider';
6969
import type { WebviewShowOptions } from '../webviewsController';
7070
import type {
71+
BranchAndTargetRefs,
7172
BranchRef,
7273
CollapseSectionParams,
7374
DidChangeRepositoriesParams,
@@ -1167,8 +1168,8 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
11671168
});
11681169
}
11691170

1170-
private mergeTargetCompare(ref: BranchRef & { mergeTargetId: string }) {
1171-
return this.container.views.searchAndCompare.compare(ref.repoPath, ref.branchId, ref.mergeTargetId);
1171+
private mergeTargetCompare(ref: BranchAndTargetRefs) {
1172+
return this.container.views.searchAndCompare.compare(ref.repoPath, ref.branchName, ref.mergeTargetName);
11721173
}
11731174

11741175
private async pullRequestCompare(ref: BranchRef) {

src/webviews/home/protocol.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,3 +322,8 @@ export interface BranchRef {
322322
branchId: string;
323323
branchName: string;
324324
}
325+
326+
export interface BranchAndTargetRefs extends BranchRef {
327+
mergeTargetId: string;
328+
mergeTargetName: string;
329+
}

0 commit comments

Comments
 (0)