mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 10:58:34 -05:00
Fixes issue with incorrect uris
This commit is contained in:
@@ -65,11 +65,11 @@ export class ShowQuickCommitDetailsCommand extends ActiveEditorCommand {
|
|||||||
// TODO: Leave this at undefined until findMostRecentCommitForFile actually works
|
// TODO: Leave this at undefined until findMostRecentCommitForFile actually works
|
||||||
workingFileName = !workingCommit ? pick.fileName : undefined;
|
workingFileName = !workingCommit ? pick.fileName : undefined;
|
||||||
|
|
||||||
log = await this.git.getLogForFile(pick.uri.fsPath, pick.sha, undefined, undefined, 2);
|
log = await this.git.getLogForFile(pick.gitUri.fsPath, pick.sha, undefined, undefined, 2);
|
||||||
if (!log) return window.showWarningMessage(`Unable to open diff`);
|
if (!log) return window.showWarningMessage(`Unable to show commit details`);
|
||||||
|
|
||||||
commit = Iterables.find(log.commits.values(), c => c.sha === commit.sha);
|
commit = Iterables.find(log.commits.values(), c => c.sha === commit.sha);
|
||||||
uri = pick.uri || uri;
|
uri = pick.gitUri || uri;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Attempt to the most recent commit -- so that we can find the real working filename if there was a rename
|
// Attempt to the most recent commit -- so that we can find the real working filename if there was a rename
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { QuickPickItem, Uri } from 'vscode';
|
import { QuickPickItem, Uri } from 'vscode';
|
||||||
import { getGitStatusIcon, GitCommit, GitFileStatus, GitUri } from '../gitProvider';
|
import GitProvider, { getGitStatusIcon, GitCommit, GitFileStatus, GitUri } from '../gitProvider';
|
||||||
import { OpenFileCommandQuickPickItem } from './quickPicks';
|
import { OpenFileCommandQuickPickItem } from './quickPicks';
|
||||||
import * as moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
@@ -21,6 +21,7 @@ export class CommitQuickPickItem implements QuickPickItem {
|
|||||||
export class CommitWithFileStatusQuickPickItem extends OpenFileCommandQuickPickItem {
|
export class CommitWithFileStatusQuickPickItem extends OpenFileCommandQuickPickItem {
|
||||||
|
|
||||||
fileName: string;
|
fileName: string;
|
||||||
|
gitUri: GitUri;
|
||||||
sha: string;
|
sha: string;
|
||||||
status: GitFileStatus;
|
status: GitFileStatus;
|
||||||
|
|
||||||
@@ -32,12 +33,13 @@ export class CommitWithFileStatusQuickPickItem extends OpenFileCommandQuickPickI
|
|||||||
directory = undefined;
|
directory = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
super(GitUri.fromUri(Uri.file(path.resolve(commit.repoPath, fileName))), {
|
super(GitProvider.toGitContentUri(commit.sha, fileName, commit.repoPath, commit.originalFileName), {
|
||||||
label: `\u00a0\u00a0\u00a0\u00a0${icon}\u00a0\u00a0 ${path.basename(fileName)}`,
|
label: `\u00a0\u00a0\u00a0\u00a0${icon}\u00a0\u00a0 ${path.basename(fileName)}`,
|
||||||
description: directory
|
description: directory
|
||||||
});
|
});
|
||||||
|
|
||||||
this.fileName = fileName;
|
this.fileName = fileName;
|
||||||
|
this.gitUri = GitUri.fromUri(Uri.file(path.resolve(commit.repoPath, fileName)));
|
||||||
this.sha = commit.sha;
|
this.sha = commit.sha;
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user