mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-18 01:35:36 -05:00
Attempts to fix #58 - work with sub-modules
Also fixes issue with nested repos
This commit is contained in:
@@ -17,7 +17,7 @@ export class BranchHistoryQuickPick {
|
||||
});
|
||||
}
|
||||
|
||||
static async show(git: GitService, log: IGitLog, uri: GitUri, branch: string, progressCancellation: CancellationTokenSource, goBackCommand?: CommandQuickPickItem, nextPageCommand?: CommandQuickPickItem): Promise<CommitQuickPickItem | CommandQuickPickItem | undefined> {
|
||||
static async show(git: GitService, log: IGitLog, uri: GitUri | undefined, branch: string, progressCancellation: CancellationTokenSource, goBackCommand?: CommandQuickPickItem, nextPageCommand?: CommandQuickPickItem): Promise<CommitQuickPickItem | CommandQuickPickItem | undefined> {
|
||||
const items = Array.from(Iterables.map(log.commits.values(), c => new CommitQuickPickItem(c))) as (CommitQuickPickItem | CommandQuickPickItem)[];
|
||||
|
||||
const currentCommand = new CommandQuickPickItem({
|
||||
@@ -25,7 +25,7 @@ export class BranchHistoryQuickPick {
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 to \u00a0$(git-branch) ${branch} history`
|
||||
}, Commands.ShowQuickBranchHistory, [uri, branch, log.maxCount, goBackCommand, log]);
|
||||
|
||||
const remotes = Arrays.uniqueBy(await git.getRemotes(git.repoPath), _ => _.url, _ => !!_.provider);
|
||||
const remotes = Arrays.uniqueBy(await git.getRemotes((uri && uri.repoPath) || git.repoPath), _ => _.url, _ => !!_.provider);
|
||||
if (remotes.length) {
|
||||
items.splice(0, 0, new OpenRemotesCommandQuickPickItem(remotes, 'branch', branch, currentCommand));
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ export class CommitDetailsQuickPick {
|
||||
}, Commands.CopyMessageToClipboard, [uri, commit.sha, commit.message]));
|
||||
|
||||
if (!stash) {
|
||||
const remotes = Arrays.uniqueBy(await git.getRemotes(git.repoPath), _ => _.url, _ => !!_.provider);
|
||||
const remotes = Arrays.uniqueBy(await git.getRemotes(commit.repoPath), _ => _.url, _ => !!_.provider);
|
||||
if (remotes.length) {
|
||||
items.splice(index++, 0, new OpenRemotesCommandQuickPickItem(remotes, 'commit', commit.sha, currentCommand));
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ export class CommitFileDetailsQuickPick {
|
||||
items.push(new OpenCommitWorkingTreeFileCommandQuickPickItem(commit));
|
||||
}
|
||||
|
||||
const remotes = Arrays.uniqueBy(await git.getRemotes(git.repoPath), _ => _.url, _ => !!_.provider);
|
||||
const remotes = Arrays.uniqueBy(await git.getRemotes(commit.repoPath), _ => _.url, _ => !!_.provider);
|
||||
if (remotes.length) {
|
||||
if (!stash) {
|
||||
items.push(new OpenRemotesCommandQuickPickItem(remotes, 'file', commit.fileName, undefined, commit.sha, currentCommand));
|
||||
|
||||
@@ -74,7 +74,7 @@ export class FileHistoryQuickPick {
|
||||
}
|
||||
}
|
||||
|
||||
const branch = await git.getBranch(uri.repoPath || git.repoPath);
|
||||
const branch = await git.getBranch(uri.repoPath);
|
||||
|
||||
const currentCommand = new CommandQuickPickItem({
|
||||
label: `go back \u21A9`,
|
||||
@@ -93,7 +93,7 @@ export class FileHistoryQuickPick {
|
||||
]));
|
||||
}
|
||||
|
||||
const remotes = Arrays.uniqueBy(await git.getRemotes(git.repoPath), _ => _.url, _ => !!_.provider);
|
||||
const remotes = Arrays.uniqueBy(await git.getRemotes(uri.repoPath), _ => _.url, _ => !!_.provider);
|
||||
if (remotes.length) {
|
||||
items.splice(index++, 0, new OpenRemotesCommandQuickPickItem(remotes, 'file', uri.getRelativePath(), branch.name, uri.sha, currentCommand));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user