mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-03 17:25:36 -05:00
Adds blame and active line annotation support to git diff split view
Adds command (compare, copy sha/message, etc) support to git diff split view Fixes #41 - Toggle Blame annotations on compare files page
This commit is contained in:
@@ -28,7 +28,7 @@ export class CopyMessageToClipboardCommand extends ActiveEditorCommand {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
|
||||
if (!message) {
|
||||
if (!sha) {
|
||||
|
||||
@@ -28,7 +28,7 @@ export class CopyShaToClipboardCommand extends ActiveEditorCommand {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
|
||||
if (!sha) {
|
||||
if (editor && editor.document && editor.document.isDirty) return undefined;
|
||||
|
||||
@@ -20,7 +20,7 @@ export class DiffLineWithPreviousCommand extends ActiveEditorCommand {
|
||||
uri = editor.document.uri;
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
line = line || (editor && editor.selection.active.line) || gitUri.offset;
|
||||
|
||||
if (!commit || GitProvider.isUncommitted(commit.sha)) {
|
||||
|
||||
@@ -18,7 +18,7 @@ export class DiffLineWithWorkingCommand extends ActiveEditorCommand {
|
||||
uri = editor.document.uri;
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
line = line || (editor && editor.selection.active.line) || gitUri.offset;
|
||||
|
||||
if (!commit || GitProvider.isUncommitted(commit.sha)) {
|
||||
|
||||
@@ -31,7 +31,7 @@ export class DiffWithPreviousCommand extends ActiveEditorCommand {
|
||||
}
|
||||
|
||||
if (!commit || rangeOrLine instanceof Range) {
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
|
||||
try {
|
||||
if (!gitUri.sha) {
|
||||
|
||||
@@ -24,7 +24,7 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand {
|
||||
line = line || (editor && editor.selection.active.line) || 0;
|
||||
|
||||
if (!commit || GitProvider.isUncommitted(commit.sha)) {
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
|
||||
try {
|
||||
const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath, undefined, gitUri.sha ? undefined : 1);
|
||||
@@ -38,7 +38,7 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand {
|
||||
}
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
|
||||
try {
|
||||
const compare = await this.git.getVersionedFile(commit.uri.fsPath, commit.repoPath, commit.sha);
|
||||
|
||||
@@ -23,7 +23,7 @@ export class ShowBlameHistoryCommand extends EditorCommand {
|
||||
position = editor.document.validateRange(new Range(0, 0, 0, 1000000)).start;
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
|
||||
try {
|
||||
const locations = await this.git.getBlameLocations(gitUri.fsPath, range, gitUri.sha, gitUri.repoPath, sha, line);
|
||||
|
||||
@@ -22,7 +22,7 @@ export class ShowFileHistoryCommand extends EditorCommand {
|
||||
position = editor.document.validateRange(new Range(0, 0, 0, 1000000)).start;
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
|
||||
try {
|
||||
const locations = await this.git.getLogLocations(gitUri.fsPath, gitUri.sha, gitUri.repoPath, sha, line);
|
||||
|
||||
@@ -18,7 +18,7 @@ export class ShowQuickCommitDetailsCommand extends ActiveEditorCommand {
|
||||
uri = editor.document.uri;
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
|
||||
let repoPath = gitUri.repoPath;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export class ShowQuickFileHistoryCommand extends ActiveEditorCommand {
|
||||
return commands.executeCommand(Commands.ShowQuickRepoHistory);
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
|
||||
if (maxCount == null) {
|
||||
maxCount = this.git.config.advanced.maxQuickHistory;
|
||||
|
||||
@@ -23,7 +23,7 @@ export class ShowQuickRepoHistoryCommand extends ActiveEditorCommand {
|
||||
try {
|
||||
let repoPath: string;
|
||||
if (uri instanceof Uri) {
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
repoPath = gitUri.repoPath;
|
||||
|
||||
if (!repoPath) {
|
||||
|
||||
@@ -19,7 +19,7 @@ export class ShowQuickRepoStatusCommand extends ActiveEditorCommand {
|
||||
try {
|
||||
let repoPath: string;
|
||||
if (uri instanceof Uri) {
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
repoPath = gitUri.repoPath;
|
||||
|
||||
if (!repoPath) {
|
||||
|
||||
Reference in New Issue
Block a user