mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-14 10:03:15 -05:00
Consolidates certain getLogForFile usage patterns into getLogCommit
This commit is contained in:
@@ -39,10 +39,8 @@ export class CommitFileDetailsQuickPick {
|
||||
const isUncommitted = commit.isUncommitted;
|
||||
if (isUncommitted) {
|
||||
// Since we can't trust the previous sha on an uncommitted commit, find the last commit for this file
|
||||
const log = await git.getLogForFile(undefined, commit.uri.fsPath, undefined, undefined, 2);
|
||||
if (!log) return undefined;
|
||||
|
||||
commit = Iterables.first(log.commits.values());
|
||||
commit = await git.getLogCommit(undefined, commit.uri.fsPath, { previous: true });
|
||||
if (!commit) return undefined;
|
||||
}
|
||||
|
||||
items.push(new CommandQuickPickItem({
|
||||
@@ -141,7 +139,7 @@ export class CommitFileDetailsQuickPick {
|
||||
c = undefined;
|
||||
|
||||
// Try to find the next commit
|
||||
const nextLog = await git.getLogForFile(commit.repoPath, uri.fsPath, commit.sha, undefined, 1, true);
|
||||
const nextLog = await git.getLogForFile(commit.repoPath, uri.fsPath, commit.sha, undefined, 1, true, true);
|
||||
const next = nextLog && Iterables.first(nextLog.commits.values());
|
||||
if (next && next.sha !== commit.sha) {
|
||||
c = commit;
|
||||
|
||||
Reference in New Issue
Block a user