Skip to content

Commit 12d8343

Browse files
committed
Switches deeplinks to comparison to use SHAs
1 parent 4cd3a11 commit 12d8343

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/commands/copyDeepLink.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ export class CopyDeepLinkCommand extends ActiveEditorCommand {
5353
if (args == null) {
5454
if (isCommandContextViewNodeHasCommit(context)) {
5555
args = { refOrRepoPath: context.node.commit };
56+
} else if (isCommandContextViewNodeHasComparison(context)) {
57+
args = {
58+
refOrRepoPath: context.node.uri.fsPath,
59+
compareRef: context.node.compareRef,
60+
compareWithRef: context.node.compareWithRef,
61+
};
5662
} else if (isCommandContextViewNodeHasBranch(context)) {
5763
if (context.command === Commands.CopyDeepLinkToRepo) {
5864
args = {
@@ -66,12 +72,6 @@ export class CopyDeepLinkCommand extends ActiveEditorCommand {
6672
args = { refOrRepoPath: context.node.tag };
6773
} else if (isCommandContextViewNodeHasRemote(context)) {
6874
args = { refOrRepoPath: context.node.remote.repoPath, remote: context.node.remote.name };
69-
} else if (isCommandContextViewNodeHasComparison(context)) {
70-
args = {
71-
refOrRepoPath: context.node.uri.fsPath,
72-
compareRef: context.node.compareRef,
73-
compareWithRef: context.node.compareWithRef,
74-
};
7575
} else if (isCommandContextViewNodeHasWorkspace(context)) {
7676
args = { workspaceId: context.node.workspace.id };
7777
}

src/uris/deepLinks/deepLinkService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,8 +1562,8 @@ export class DeepLinkService implements Disposable {
15621562

15631563
if (compareRef != null && compareWithRef != null) {
15641564
targetType = DeepLinkType.Comparison;
1565-
targetId = compareRef.label ?? compareRef.ref;
1566-
compareWithTargetId = compareWithRef.label ?? compareWithRef.ref;
1565+
targetId = compareRef.ref ?? compareRef.label;
1566+
compareWithTargetId = compareWithRef.ref ?? compareWithRef.label;
15671567
}
15681568

15691569
let target;

0 commit comments

Comments
 (0)