mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-09 01:32:40 -05:00
Avoids re-setting the line if it is already set
This commit is contained in:
@@ -25,7 +25,9 @@ export class DiffWithBranchCommand extends ActiveEditorCommand {
|
|||||||
uri = getCommandUri(uri, editor);
|
uri = getCommandUri(uri, editor);
|
||||||
if (uri === undefined) return undefined;
|
if (uri === undefined) return undefined;
|
||||||
|
|
||||||
args.line = args.line || (editor === undefined ? 0 : editor.selection.active.line);
|
if (args.line === undefined) {
|
||||||
|
args.line = editor === undefined ? 0 : editor.selection.active.line;
|
||||||
|
}
|
||||||
|
|
||||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
if (!gitUri.repoPath) return Messages.showNoRepositoryWarningMessage(`Unable to open branch compare`);
|
if (!gitUri.repoPath) return Messages.showNoRepositoryWarningMessage(`Unable to open branch compare`);
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ export class DiffWithNextCommand extends ActiveEditorCommand {
|
|||||||
uri = getCommandUri(uri, editor);
|
uri = getCommandUri(uri, editor);
|
||||||
if (uri === undefined) return undefined;
|
if (uri === undefined) return undefined;
|
||||||
|
|
||||||
args.line = args.line || (editor === undefined ? 0 : editor.selection.active.line);
|
if (args.line === undefined) {
|
||||||
|
args.line = editor === undefined ? 0 : editor.selection.active.line;
|
||||||
|
}
|
||||||
|
|
||||||
if (args.commit === undefined || !(args.commit instanceof GitLogCommit) || args.range !== undefined) {
|
if (args.commit === undefined || !(args.commit instanceof GitLogCommit) || args.range !== undefined) {
|
||||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand {
|
|||||||
uri = getCommandUri(uri, editor);
|
uri = getCommandUri(uri, editor);
|
||||||
if (uri === undefined) return undefined;
|
if (uri === undefined) return undefined;
|
||||||
|
|
||||||
args.line = args.line || (editor === undefined ? 0 : editor.selection.active.line);
|
if (args.line === undefined) {
|
||||||
|
args.line = editor === undefined ? 0 : editor.selection.active.line;
|
||||||
|
}
|
||||||
|
|
||||||
if (args.commit === undefined || GitService.isUncommitted(args.commit.sha)) {
|
if (args.commit === undefined || GitService.isUncommitted(args.commit.sha)) {
|
||||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
|||||||
Reference in New Issue
Block a user