mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-16 09:35:40 -05:00
Fixes issues with next commit navigation (renames)
Adds sha to log model to know if it is a full log or not
This commit is contained in:
@@ -31,7 +31,7 @@ export class BranchHistoryQuickPick {
|
||||
|
||||
let previousPageCommand: CommandQuickPickItem;
|
||||
|
||||
if ((log.truncated || (uri && uri.sha))) {
|
||||
if (log.truncated || log.sha) {
|
||||
if (log.truncated) {
|
||||
items.splice(0, 0, new CommandQuickPickItem({
|
||||
label: `$(sync) Show All Commits`,
|
||||
|
||||
@@ -84,7 +84,7 @@ export class CommitDetailsQuickPick {
|
||||
let previousCommand: CommandQuickPickItem | (() => Promise<CommandQuickPickItem>);
|
||||
let nextCommand: CommandQuickPickItem | (() => Promise<CommandQuickPickItem>);
|
||||
// If we have the full history, we are good
|
||||
if (repoLog && !repoLog.truncated) {
|
||||
if (repoLog && !repoLog.truncated && !repoLog.sha) {
|
||||
previousCommand = commit.previousSha && new KeyCommandQuickPickItem(Commands.ShowQuickCommitDetails, [commit.previousUri, commit.previousSha, undefined, goBackCommand, repoLog]);
|
||||
nextCommand = commit.nextSha && new KeyCommandQuickPickItem(Commands.ShowQuickCommitDetails, [commit.nextUri, commit.nextSha, undefined, goBackCommand, repoLog]);
|
||||
}
|
||||
@@ -103,7 +103,7 @@ export class CommitDetailsQuickPick {
|
||||
c.nextSha = commit.nextSha;
|
||||
}
|
||||
}
|
||||
if (!c) return KeyNoopCommand;
|
||||
if (!c || !c.previousSha) return KeyNoopCommand;
|
||||
return new KeyCommandQuickPickItem(Commands.ShowQuickCommitDetails, [c.previousUri, c.previousSha, undefined, goBackCommand, log]);
|
||||
};
|
||||
|
||||
@@ -124,7 +124,7 @@ export class CommitDetailsQuickPick {
|
||||
c.nextSha = next.sha;
|
||||
}
|
||||
}
|
||||
if (!c) return KeyNoopCommand;
|
||||
if (!c || !c.nextSha) return KeyNoopCommand;
|
||||
return new KeyCommandQuickPickItem(Commands.ShowQuickCommitDetails, [c.nextUri, c.nextSha, undefined, goBackCommand, log]);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
'use strict';
|
||||
import { Arrays, Iterables } from '../system';
|
||||
import { Arrays } from '../system';
|
||||
import { QuickPickItem, QuickPickOptions, Uri, window } from 'vscode';
|
||||
import { Commands, Keyboard, KeyNoopCommand } from '../commands';
|
||||
import { GitCommit, GitLogCommit, GitService, GitUri, IGitLog } from '../gitService';
|
||||
@@ -105,7 +105,7 @@ export class CommitFileDetailsQuickPick {
|
||||
let previousCommand: CommandQuickPickItem | (() => Promise<CommandQuickPickItem>);
|
||||
let nextCommand: CommandQuickPickItem | (() => Promise<CommandQuickPickItem>);
|
||||
// If we have the full history, we are good
|
||||
if (fileLog && !fileLog.truncated) {
|
||||
if (fileLog && !fileLog.truncated && !fileLog.sha) {
|
||||
previousCommand = commit.previousSha && new KeyCommandQuickPickItem(Commands.ShowQuickCommitFileDetails, [commit.previousUri, commit.previousSha, undefined, goBackCommand, fileLog]);
|
||||
nextCommand = commit.nextSha && new KeyCommandQuickPickItem(Commands.ShowQuickCommitFileDetails, [commit.nextUri, commit.nextSha, undefined, goBackCommand, fileLog]);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ export class CommitFileDetailsQuickPick {
|
||||
|
||||
// If we can't find the commit or the previous commit isn't available (since it isn't trustworthy)
|
||||
if (!c || !c.previousSha) {
|
||||
log = await git.getLogForFile(commit.repoPath, uri.fsPath, commit.sha, undefined, git.config.advanced.maxQuickHistory);
|
||||
log = await git.getLogForFile(commit.repoPath, uri.fsPath, commit.sha, git.config.advanced.maxQuickHistory);
|
||||
c = log && log.commits.get(commit.sha);
|
||||
|
||||
if (c) {
|
||||
@@ -125,7 +125,7 @@ export class CommitFileDetailsQuickPick {
|
||||
c.nextFileName = commit.nextFileName;
|
||||
}
|
||||
}
|
||||
if (!c) return KeyNoopCommand;
|
||||
if (!c || !c.previousSha) return KeyNoopCommand;
|
||||
return new KeyCommandQuickPickItem(Commands.ShowQuickCommitFileDetails, [c.previousUri, c.previousSha, undefined, goBackCommand, log]);
|
||||
};
|
||||
|
||||
@@ -139,15 +139,14 @@ 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, true);
|
||||
const next = nextLog && Iterables.first(nextLog.commits.values());
|
||||
const next = await git.findNextCommit(commit.repoPath, uri.fsPath, commit.sha);
|
||||
if (next && next.sha !== commit.sha) {
|
||||
c = commit;
|
||||
c.nextSha = next.sha;
|
||||
c.nextFileName = next.originalFileName || next.fileName;
|
||||
}
|
||||
}
|
||||
if (!c) return KeyNoopCommand;
|
||||
if (!c || !c.nextSha) return KeyNoopCommand;
|
||||
return new KeyCommandQuickPickItem(Commands.ShowQuickCommitFileDetails, [c.nextUri, c.nextSha, undefined, goBackCommand, log]);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export class FileHistoryQuickPick {
|
||||
let previousPageCommand: CommandQuickPickItem;
|
||||
|
||||
let index = 0;
|
||||
if (log.truncated || uri.sha) {
|
||||
if (log.truncated || log.sha) {
|
||||
if (log.truncated) {
|
||||
index++;
|
||||
items.splice(0, 0, new CommandQuickPickItem({
|
||||
|
||||
Reference in New Issue
Block a user