瀏覽代碼

Adds Copy Remote Url to quickpicks

main
Eric Amodio 5 年之前
父節點
當前提交
a75cba59ef
共有 2 個檔案被更改,包括 38 行新增1 行删除
  1. +16
    -0
      src/quickpicks/commitFileQuickPick.ts
  2. +22
    -1
      src/quickpicks/commitQuickPick.ts

+ 16
- 0
src/quickpicks/commitFileQuickPick.ts 查看文件

@ -4,6 +4,7 @@ import { commands, QuickPickItem, TextDocumentShowOptions, TextEditor, Uri, wind
import {
Commands,
CopyMessageToClipboardCommandArgs,
CopyRemoteFileUrlToClipboardCommandArgs,
CopyShaToClipboardCommandArgs,
DiffWithPreviousCommandArgs,
DiffWithWorkingCommandArgs,
@ -255,6 +256,21 @@ export class CommitFileQuickPick {
[uri, copyMessageCommandArgs]
)
);
if (remotes.length) {
const copyRemoteUrlCommandArgs: CopyRemoteFileUrlToClipboardCommandArgs = {
sha: commit.sha
};
items.push(
new CommandQuickPickItem(
{
label: '$(clippy) Copy Remote Url to Clipboard'
},
Commands.CopyRemoteFileUrlToClipboard,
[uri, copyRemoteUrlCommandArgs]
)
);
}
}
if (workingUri) {

+ 22
- 1
src/quickpicks/commitQuickPick.ts 查看文件

@ -4,6 +4,7 @@ import { commands, TextDocumentShowOptions, TextEditor, Uri, window } from 'vsco
import {
Commands,
CopyMessageToClipboardCommandArgs,
CopyRemoteFileUrlToClipboardCommandArgs,
CopyShaToClipboardCommandArgs,
DiffDirectoryCommandArgs,
DiffWithPreviousCommandArgs,
@ -248,6 +249,7 @@ export class CommitQuickPick {
let index = 0;
let remotes;
if (stash) {
const stashApplyCommmandArgs: StashApplyCommandArgs = {
confirm: true,
@ -291,7 +293,7 @@ export class CommitQuickPick {
else {
items.splice(index++, 0, new ShowCommitInViewQuickPickItem(commit));
const remotes = await Container.git.getRemotes(commit.repoPath);
remotes = await Container.git.getRemotes(commit.repoPath);
if (remotes.length) {
items.splice(
index++,
@ -383,6 +385,25 @@ export class CommitQuickPick {
)
);
if (!stash) {
if (remotes !== undefined && remotes.length) {
const copyRemoteUrlCommandArgs: CopyRemoteFileUrlToClipboardCommandArgs = {
sha: commit.sha
};
items.splice(
index++,
0,
new CommandQuickPickItem(
{
label: '$(clippy) Copy Remote Url to Clipboard'
},
Commands.CopyRemoteFileUrlToClipboard,
[uri, copyRemoteUrlCommandArgs]
)
);
}
}
const commitDetailsCommandArgs: ShowQuickCommitDetailsCommandArgs = {
commit: commit,
repoLog: options.repoLog,

Loading…
取消
儲存