浏览代码

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 {
CopyMessageToClipboardCommandArgs,
CopyShaToClipboardCommandArgs,
OpenBranchOnRemoteCommandArgs,
OpenCommitOnRemoteCommandArgs,
OpenOnRemoteCommandArgs,
OpenPullRequestOnRemoteCommandArgs,
ShowCommitsInViewCommandArgs,
} from '../../../commands';
@ -52,6 +51,7 @@ import type {
} from '../../../git/models/reference';
import { GitReference, GitRevision } from '../../../git/models/reference';
import { getRemoteIconUri } from '../../../git/models/remote';
import { RemoteResourceType } from '../../../git/models/remoteResource';
import type { RepositoryChangeEvent, RepositoryFileSystemChangeEvent } from '../../../git/models/repository';
import { Repository, RepositoryChange, RepositoryChangeComparisonMode } from '../../../git/models/repository';
import type { GitSearch } from '../../../git/search';
@ -1976,8 +1976,12 @@ export class GraphWebview extends WebviewBase {
private openBranchOnRemote(item?: GraphItemContext, clipboard?: boolean) {
if (isGraphItemRefContext(item, 'branch')) {
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,
clipboard: clipboard,
});
@ -2100,8 +2104,12 @@ export class GraphWebview extends WebviewBase {
const ref = this.getGraphItemRef(item, 'revision');
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,
});
}

正在加载...
取消
保存