Bladeren bron

Adds Copy Remote Url to quickpicks

main
Eric Amodio 5 jaren geleden
bovenliggende
commit
a75cba59ef
2 gewijzigde bestanden met toevoegingen van 38 en 1 verwijderingen
  1. +16
    -0
      src/quickpicks/commitFileQuickPick.ts
  2. +22
    -1
      src/quickpicks/commitQuickPick.ts

+ 16
- 0
src/quickpicks/commitFileQuickPick.ts Bestand weergeven

@ -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 Bestand weergeven

@ -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,

Laden…
Annuleren
Opslaan