mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 18:48:45 -05:00
Stops some code lens actions when uncommitted
This commit is contained in:
@@ -360,7 +360,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_applyDiffWithPreviousCommand<T extends GitRecentChangeCodeLens | GitAuthorsCodeLens>(title: string, lens: T, blame: IGitBlameLines, commit?: GitCommit): T {
|
_applyDiffWithPreviousCommand<T extends GitRecentChangeCodeLens | GitAuthorsCodeLens>(title: string, lens: T, blame: IGitBlameLines, commit?: GitCommit): T {
|
||||||
if (!commit) {
|
if (commit === undefined) {
|
||||||
const blameLine = blame.allLines[lens.range.start.line];
|
const blameLine = blame.allLines[lens.range.start.line];
|
||||||
commit = blame.commits.get(blameLine.sha);
|
commit = blame.commits.get(blameLine.sha);
|
||||||
}
|
}
|
||||||
@@ -382,7 +382,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
|
|||||||
_applyShowQuickCommitDetailsCommand<T extends GitRecentChangeCodeLens | GitAuthorsCodeLens>(title: string, lens: T, blame: IGitBlameLines, commit?: GitCommit): T {
|
_applyShowQuickCommitDetailsCommand<T extends GitRecentChangeCodeLens | GitAuthorsCodeLens>(title: string, lens: T, blame: IGitBlameLines, commit?: GitCommit): T {
|
||||||
lens.command = {
|
lens.command = {
|
||||||
title: title,
|
title: title,
|
||||||
command: CodeLensCommand.ShowQuickCommitDetails,
|
command: commit !== undefined && commit.isUncommitted ? '' : CodeLensCommand.ShowQuickCommitDetails,
|
||||||
arguments: [
|
arguments: [
|
||||||
Uri.file(lens.uri.fsPath),
|
Uri.file(lens.uri.fsPath),
|
||||||
{
|
{
|
||||||
@@ -396,7 +396,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
|
|||||||
_applyShowQuickCommitFileDetailsCommand<T extends GitRecentChangeCodeLens | GitAuthorsCodeLens>(title: string, lens: T, blame: IGitBlameLines, commit?: GitCommit): T {
|
_applyShowQuickCommitFileDetailsCommand<T extends GitRecentChangeCodeLens | GitAuthorsCodeLens>(title: string, lens: T, blame: IGitBlameLines, commit?: GitCommit): T {
|
||||||
lens.command = {
|
lens.command = {
|
||||||
title: title,
|
title: title,
|
||||||
command: CodeLensCommand.ShowQuickCommitFileDetails,
|
command: commit !== undefined && commit.isUncommitted ? '' : CodeLensCommand.ShowQuickCommitFileDetails,
|
||||||
arguments: [
|
arguments: [
|
||||||
Uri.file(lens.uri.fsPath),
|
Uri.file(lens.uri.fsPath),
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user