mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 10:58:34 -05:00
Removes some commands when dealing with a stash
This commit is contained in:
@@ -73,7 +73,6 @@ export class CommitDetailsQuickPick {
|
|||||||
const items: (CommitWithFileStatusQuickPickItem | CommandQuickPickItem)[] = commit.fileStatuses.map(fs => new CommitWithFileStatusQuickPickItem(commit, fs));
|
const items: (CommitWithFileStatusQuickPickItem | CommandQuickPickItem)[] = commit.fileStatuses.map(fs => new CommitWithFileStatusQuickPickItem(commit, fs));
|
||||||
|
|
||||||
const stash = commit.type === 'stash';
|
const stash = commit.type === 'stash';
|
||||||
const type = stash ? 'Stash' : 'Commit';
|
|
||||||
|
|
||||||
let index = 0;
|
let index = 0;
|
||||||
|
|
||||||
@@ -89,13 +88,15 @@ export class CommitDetailsQuickPick {
|
|||||||
}, Commands.StashDelete, [commit as GitStashCommit, true]));
|
}, Commands.StashDelete, [commit as GitStashCommit, true]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!stash) {
|
||||||
items.splice(index++, 0, new CommandQuickPickItem({
|
items.splice(index++, 0, new CommandQuickPickItem({
|
||||||
label: `$(clippy) Copy ${type} Sha to Clipboard`,
|
label: `$(clippy) Copy Commit Sha to Clipboard`,
|
||||||
description: `\u00a0 \u2014 \u00a0\u00a0 ${commit.shortSha}`
|
description: `\u00a0 \u2014 \u00a0\u00a0 ${commit.shortSha}`
|
||||||
}, Commands.CopyShaToClipboard, [uri, commit.sha]));
|
}, Commands.CopyShaToClipboard, [uri, commit.sha]));
|
||||||
|
}
|
||||||
|
|
||||||
items.splice(index++, 0, new CommandQuickPickItem({
|
items.splice(index++, 0, new CommandQuickPickItem({
|
||||||
label: `$(clippy) Copy ${type} Message to Clipboard`,
|
label: `$(clippy) Copy Message to Clipboard`,
|
||||||
description: `\u00a0 \u2014 \u00a0\u00a0 ${commit.message}`
|
description: `\u00a0 \u2014 \u00a0\u00a0 ${commit.message}`
|
||||||
}, Commands.CopyMessageToClipboard, [uri, commit.sha, commit.message]));
|
}, Commands.CopyMessageToClipboard, [uri, commit.sha, commit.message]));
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export class CommitFileDetailsQuickPick {
|
|||||||
}, Commands.CopyShaToClipboard, [uri, commit.sha]));
|
}, Commands.CopyShaToClipboard, [uri, commit.sha]));
|
||||||
|
|
||||||
items.push(new CommandQuickPickItem({
|
items.push(new CommandQuickPickItem({
|
||||||
label: `$(clippy) Copy Commit Message to Clipboard`,
|
label: `$(clippy) Copy Message to Clipboard`,
|
||||||
description: `\u00a0 \u2014 \u00a0\u00a0 ${commit.message}`
|
description: `\u00a0 \u2014 \u00a0\u00a0 ${commit.message}`
|
||||||
}, Commands.CopyMessageToClipboard, [uri, commit.sha, commit.message]));
|
}, Commands.CopyMessageToClipboard, [uri, commit.sha, commit.message]));
|
||||||
}
|
}
|
||||||
@@ -102,10 +102,12 @@ export class CommitFileDetailsQuickPick {
|
|||||||
}, Commands.ShowQuickFileHistory, [Uri.file(path.resolve(commit.repoPath, commit.workingFileName)), undefined, undefined, currentCommand, fileLog]));
|
}, Commands.ShowQuickFileHistory, [Uri.file(path.resolve(commit.repoPath, commit.workingFileName)), undefined, undefined, currentCommand, fileLog]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!stash) {
|
||||||
items.push(new CommandQuickPickItem({
|
items.push(new CommandQuickPickItem({
|
||||||
label: `$(history) Show ${commit.workingFileName ? 'Previous ' : ''}File History`,
|
label: `$(history) Show ${commit.workingFileName ? 'Previous ' : ''}File History`,
|
||||||
description: `\u00a0 \u2014 \u00a0\u00a0 of ${path.basename(commit.fileName)} \u00a0\u2022\u00a0 from \u00a0$(git-commit) ${commit.shortSha}`
|
description: `\u00a0 \u2014 \u00a0\u00a0 of ${path.basename(commit.fileName)} \u00a0\u2022\u00a0 from \u00a0$(git-commit) ${commit.shortSha}`
|
||||||
}, Commands.ShowQuickFileHistory, [new GitUri(commit.uri, commit), undefined, undefined, currentCommand]));
|
}, Commands.ShowQuickFileHistory, [new GitUri(commit.uri, commit), undefined, undefined, currentCommand]));
|
||||||
|
}
|
||||||
|
|
||||||
if (goBackCommand) {
|
if (goBackCommand) {
|
||||||
items.splice(0, 0, goBackCommand);
|
items.splice(0, 0, goBackCommand);
|
||||||
|
|||||||
Reference in New Issue
Block a user