瀏覽代碼

Fixes remote URLs on Graph w/ multiple repos open

main
Eric Amodio 1 年之前
父節點
當前提交
b1d05b7de3
共有 1 個文件被更改,包括 14 次插入6 次删除
  1. +14
    -6
      src/plus/webviews/graph/graphWebview.ts

+ 14
- 6
src/plus/webviews/graph/graphWebview.ts 查看文件

@ -21,8 +21,7 @@ import { getAvatarUri } from '../../../avatars';
import type { import type {
CopyMessageToClipboardCommandArgs, CopyMessageToClipboardCommandArgs,
CopyShaToClipboardCommandArgs, CopyShaToClipboardCommandArgs,
OpenBranchOnRemoteCommandArgs,
OpenCommitOnRemoteCommandArgs,
OpenOnRemoteCommandArgs,
OpenPullRequestOnRemoteCommandArgs, OpenPullRequestOnRemoteCommandArgs,
ShowCommitsInViewCommandArgs, ShowCommitsInViewCommandArgs,
} from '../../../commands'; } from '../../../commands';
@ -52,6 +51,7 @@ import type {
} from '../../../git/models/reference'; } from '../../../git/models/reference';
import { GitReference, GitRevision } from '../../../git/models/reference'; import { GitReference, GitRevision } from '../../../git/models/reference';
import { getRemoteIconUri } from '../../../git/models/remote'; import { getRemoteIconUri } from '../../../git/models/remote';
import { RemoteResourceType } from '../../../git/models/remoteResource';
import type { RepositoryChangeEvent, RepositoryFileSystemChangeEvent } from '../../../git/models/repository'; import type { RepositoryChangeEvent, RepositoryFileSystemChangeEvent } from '../../../git/models/repository';
import { Repository, RepositoryChange, RepositoryChangeComparisonMode } from '../../../git/models/repository'; import { Repository, RepositoryChange, RepositoryChangeComparisonMode } from '../../../git/models/repository';
import type { GitSearch } from '../../../git/search'; import type { GitSearch } from '../../../git/search';
@ -1976,8 +1976,12 @@ export class GraphWebview extends WebviewBase {
private openBranchOnRemote(item?: GraphItemContext, clipboard?: boolean) { private openBranchOnRemote(item?: GraphItemContext, clipboard?: boolean) {
if (isGraphItemRefContext(item, 'branch')) { if (isGraphItemRefContext(item, 'branch')) {
const { ref } = item.webviewItemValue; const { ref } = item.webviewItemValue;
return executeCommand<OpenBranchOnRemoteCommandArgs>(Commands.OpenBranchOnRemote, {
branch: ref.name,
return executeCommand<OpenOnRemoteCommandArgs>(Commands.OpenOnRemote, {
repoPath: ref.repoPath,
resource: {
type: RemoteResourceType.Branch,
branch: ref.name,
},
remote: ref.upstream?.name, remote: ref.upstream?.name,
clipboard: clipboard, clipboard: clipboard,
}); });
@ -2100,8 +2104,12 @@ export class GraphWebview extends WebviewBase {
const ref = this.getGraphItemRef(item, 'revision'); const ref = this.getGraphItemRef(item, 'revision');
if (ref == null) return Promise.resolve(); if (ref == null) return Promise.resolve();
return executeCommand<OpenCommitOnRemoteCommandArgs>(Commands.OpenCommitOnRemote, {
sha: ref.ref,
return executeCommand<OpenOnRemoteCommandArgs>(Commands.OpenOnRemote, {
repoPath: ref.repoPath,
resource: {
type: RemoteResourceType.Commit,
sha: ref.ref,
},
clipboard: clipboard, clipboard: clipboard,
}); });
} }

Loading…
取消
儲存