mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-23 01:35:37 -05:00
Adds support for blame & log on compare files
Allows for deep navigation through git history
This commit is contained in:
@@ -21,7 +21,7 @@ export default class DiffLineWithPreviousCommand extends EditorCommand {
|
||||
line = line || editor.selection.active.line;
|
||||
|
||||
if (!commit || GitProvider.isUncommitted(commit.sha)) {
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const blameline = line - gitUri.offset;
|
||||
if (blameline < 0) return undefined;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export default class DiffLineWithWorkingCommand extends EditorCommand {
|
||||
line = line || editor.selection.active.line;
|
||||
|
||||
if (!commit || GitProvider.isUncommitted(commit.sha)) {
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
const blameline = line - gitUri.offset;
|
||||
if (blameline < 0) return undefined;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export default class DiffWithPreviousCommand extends EditorCommand {
|
||||
}
|
||||
|
||||
if (!commit || rangeOrLine instanceof Range) {
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
|
||||
try {
|
||||
const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath, <Range>rangeOrLine);
|
||||
|
||||
@@ -23,7 +23,7 @@ export default class DiffWithWorkingCommand extends EditorCommand {
|
||||
line = line || editor.selection.active.line;
|
||||
|
||||
if (!commit || GitProvider.isUncommitted(commit.sha)) {
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
|
||||
try {
|
||||
const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath);
|
||||
@@ -37,7 +37,7 @@ export default class DiffWithWorkingCommand extends EditorCommand {
|
||||
}
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
|
||||
try {
|
||||
const compare = await this.git.getVersionedFile(commit.uri.fsPath, commit.repoPath, commit.sha);
|
||||
|
||||
@@ -20,7 +20,7 @@ export default class ShowBlameHistoryCommand extends EditorCommand {
|
||||
position = editor.document.validateRange(new Range(0, 0, 0, 1000000)).start;
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
|
||||
try {
|
||||
const locations = await this.git.getBlameLocations(gitUri.fsPath, range, gitUri.sha, gitUri.repoPath, sha, line);
|
||||
|
||||
@@ -19,7 +19,7 @@ export default class ShowFileHistoryCommand extends EditorCommand {
|
||||
position = editor.document.validateRange(new Range(0, 0, 0, 1000000)).start;
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
|
||||
try {
|
||||
const locations = await this.git.getLogLocations(gitUri.fsPath, gitUri.sha, gitUri.repoPath, sha, line);
|
||||
|
||||
@@ -19,7 +19,7 @@ export default class ShowQuickFileHistoryCommand extends EditorCommand {
|
||||
uri = editor.document.uri;
|
||||
}
|
||||
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
|
||||
try {
|
||||
const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath);
|
||||
|
||||
@@ -23,7 +23,7 @@ export default class ShowQuickRepoHistoryCommand extends Command {
|
||||
try {
|
||||
let repoPath: string;
|
||||
if (uri instanceof Uri) {
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
const gitUri = GitUri.fromUri(uri, this.git);
|
||||
repoPath = gitUri.repoPath;
|
||||
|
||||
if (!repoPath) {
|
||||
|
||||
Reference in New Issue
Block a user