Refactors commit quick pick commands

Splits showQuickCommitDetails into showQuickCommitDetails and showQuickCommitFileDetails
Adds closeUnchangedFiles command
Adds openChangedFiles command
Adds diffDirectory command
Adds contextual description to the `go back` commands
Fixes #44 by adding a warning message about Git version requirements
Fixes intermittent errors when adding active line annotations
Fixes intermittent errors when opening multiple files via quick picks
Updates dependencies
Preps v2.11.0
This commit is contained in:
Eric Amodio
2017-03-09 02:18:20 -05:00
parent 1c29fa3f33
commit eaea44872c
30 changed files with 765 additions and 354 deletions

View File

@@ -0,0 +1,70 @@
'use strict';
import { TextEditor, Uri, window } from 'vscode';
import { ActiveEditorTracker } from '../activeEditorTracker';
import { ActiveEditorCommand, Commands } from './commands';
import { TextEditorComparer, UriComparer } from '../comparers';
import { GitProvider } from '../gitProvider';
import { Logger } from '../logger';
import * as path from 'path';
export class CloseUnchangedFilesCommand extends ActiveEditorCommand {
constructor(private git: GitProvider, public repoPath: string) {
super(Commands.CloseUnchangedFiles);
}
async execute(editor: TextEditor, uri?: Uri, uris?: Uri[]) {
if (!(uri instanceof Uri)) {
uri = editor && editor.document && editor.document.uri;
}
try {
if (!uris) {
const repoPath = await this.git.getRepoPathFromUri(uri, this.repoPath);
if (!repoPath) return window.showWarningMessage(`Unable to close unchanged files`);
const statuses = await this.git.getStatusesForRepo(repoPath);
if (!statuses) return window.showWarningMessage(`Unable to close unchanged files`);
uris = statuses.map(_ => Uri.file(path.resolve(repoPath, _.fileName)));
}
const editorTracker = new ActiveEditorTracker();
let active = window.activeTextEditor;
let editor = active;
do {
if (editor) {
if ((editor.document && editor.document.isDirty) ||
uris.some(_ => UriComparer.equals(_, editor.document && editor.document.uri))) {
// If we didn't start with a valid editor, set one once we find it
if (!active) {
active = editor;
}
editor = await editorTracker.awaitNext(500);
}
else {
if (active === editor) {
active = undefined;
}
editor = await editorTracker.awaitClose(500);
}
}
else {
if (active === editor) {
active = undefined;
}
editor = await editorTracker.awaitClose(500);
}
} while ((!active && !editor) || !TextEditorComparer.equals(active, editor, { useId: true, usePosition: true }));
editorTracker.dispose();
return undefined;
}
catch (ex) {
Logger.error('[GitLens.CloseUnchangedFilesCommand]', ex);
return window.showErrorMessage(`Unable to close unchanged files. See output channel for more details`);
}
}
}

View File

@@ -1,18 +1,23 @@
'use strict';
import { commands, Disposable, TextEditor, TextEditorEdit, window } from 'vscode';
import { commands, Disposable, TextEditor, TextEditorEdit, Uri, window, workspace } from 'vscode';
import { BuiltInCommands } from '../constants';
export type Commands = 'gitlens.copyMessageToClipboard' | 'gitlens.copyShaToClipboard' | 'gitlens.diffWithPrevious' | 'gitlens.diffLineWithPrevious' | 'gitlens.diffWithWorking' | 'gitlens.diffLineWithWorking' | 'gitlens.showBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' | 'gitlens.showQuickCommitDetails' | 'gitlens.showQuickFileHistory' | 'gitlens.showQuickRepoHistory' | 'gitlens.showQuickRepoStatus' | 'gitlens.toggleBlame' | 'gitlens.toggleCodeLens';
export type Commands = 'gitlens.closeUnchangedFiles' | 'gitlens.copyMessageToClipboard' | 'gitlens.copyShaToClipboard' | 'gitlens.diffDirectory' | 'gitlens.diffWithPrevious' | 'gitlens.diffLineWithPrevious' | 'gitlens.diffWithWorking' | 'gitlens.diffLineWithWorking' | 'gitlens.openChangedFiles' | 'gitlens.showBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' | 'gitlens.showQuickCommitDetails' | 'gitlens.showQuickCommitFileDetails' | 'gitlens.showQuickFileHistory' | 'gitlens.showQuickRepoHistory' | 'gitlens.showQuickRepoStatus' | 'gitlens.toggleBlame' | 'gitlens.toggleCodeLens';
export const Commands = {
CloseUnchangedFiles: 'gitlens.closeUnchangedFiles' as Commands,
CopyMessageToClipboard: 'gitlens.copyMessageToClipboard' as Commands,
CopyShaToClipboard: 'gitlens.copyShaToClipboard' as Commands,
DiffDirectory: 'gitlens.diffDirectory' as Commands,
DiffWithPrevious: 'gitlens.diffWithPrevious' as Commands,
DiffLineWithPrevious: 'gitlens.diffLineWithPrevious' as Commands,
DiffWithWorking: 'gitlens.diffWithWorking' as Commands,
DiffLineWithWorking: 'gitlens.diffLineWithWorking' as Commands,
OpenChangedFiles: 'gitlens.openChangedFiles' as Commands,
ShowBlame: 'gitlens.showBlame' as Commands,
ShowBlameHistory: 'gitlens.showBlameHistory' as Commands,
ShowFileHistory: 'gitlens.showFileHistory' as Commands,
ShowQuickCommitDetails: 'gitlens.showQuickCommitDetails' as Commands,
ShowQuickCommitFileDetails: 'gitlens.showQuickCommitFileDetails' as Commands,
ShowQuickFileHistory: 'gitlens.showQuickFileHistory' as Commands,
ShowQuickRepoHistory: 'gitlens.showQuickRepoHistory' as Commands,
ShowQuickRepoStatus: 'gitlens.showQuickRepoStatus' as Commands,
@@ -68,4 +73,16 @@ export abstract class ActiveEditorCommand extends Disposable {
}
abstract execute(editor: TextEditor, ...args: any[]): any;
}
export async function openEditor(uri: Uri, pinned: boolean = false) {
try {
if (!pinned) return await commands.executeCommand(BuiltInCommands.Open, uri);
const document = await workspace.openTextDocument(uri);
return window.showTextDocument(document, (window.activeTextEditor && window.activeTextEditor.viewColumn) || 1, true);
}
catch (ex) {
return undefined;
}
}

View File

@@ -0,0 +1,35 @@
'use strict';
import { TextEditor, Uri, window } from 'vscode';
import { ActiveEditorCommand, Commands } from './commands';
import { GitProvider } from '../gitProvider';
import { Logger } from '../logger';
export class DiffDirectoryCommand extends ActiveEditorCommand {
constructor(private git: GitProvider, public repoPath: string) {
super(Commands.DiffDirectory);
}
async execute(editor: TextEditor, uri?: Uri, shaOrBranch1?: string, shaOrBranch2?: string): Promise<any> {
if (!(uri instanceof Uri)) {
uri = editor && editor.document && editor.document.uri;
}
try {
const repoPath = await this.git.getRepoPathFromUri(uri, this.repoPath);
if (!repoPath) return window.showWarningMessage(`Unable to open directory diff`);
if (!shaOrBranch1) {
//window.showQuickPick()
return undefined;
}
this.git.openDirectoryDiff(repoPath, shaOrBranch1, shaOrBranch2);
return undefined;
}
catch (ex) {
Logger.error('GitLens.DiffDirectoryCommand', ex);
return window.showErrorMessage(`Unable to open directory diff. See output channel for more details`);
}
}
}

View File

@@ -0,0 +1,41 @@
'use strict';
import { TextEditor, Uri, window } from 'vscode';
import { ActiveEditorCommand, Commands, openEditor } from './commands';
import { GitProvider } from '../gitProvider';
import { Logger } from '../logger';
import * as path from 'path';
export class OpenChangedFilesCommand extends ActiveEditorCommand {
constructor(private git: GitProvider, public repoPath: string) {
super(Commands.OpenChangedFiles);
}
async execute(editor: TextEditor, uri?: Uri, uris?: Uri[]) {
if (!(uri instanceof Uri)) {
uri = editor && editor.document && editor.document.uri;
}
try {
if (!uris) {
const repoPath = await this.git.getRepoPathFromUri(uri, this.repoPath);
if (!repoPath) return window.showWarningMessage(`Unable to open changed files`);
const statuses = await this.git.getStatusesForRepo(repoPath);
if (!statuses) return window.showWarningMessage(`Unable to open changed files`);
uris = statuses.filter(_ => _.status !== 'D').map(_ => Uri.file(path.resolve(repoPath, _.fileName)));
}
for (const uri of uris) {
await openEditor(uri, true);
}
return undefined;
}
catch (ex) {
Logger.error('[GitLens.OpenChangedFilesCommand]', ex);
return window.showErrorMessage(`Unable to open changed files. See output channel for more details`);
}
}
}

View File

@@ -4,7 +4,7 @@ import { commands, TextEditor, Uri, window } from 'vscode';
import { ActiveEditorCommand, Commands } from './commands';
import { GitCommit, GitLogCommit, GitProvider, GitUri } from '../gitProvider';
import { Logger } from '../logger';
import { CommandQuickPickItem, CommitFileDetailsQuickPick, CommitDetailsQuickPick, CommitWithFileStatusQuickPickItem } from '../quickPicks';
import { CommandQuickPickItem, CommitDetailsQuickPick, CommitWithFileStatusQuickPickItem } from '../quickPicks';
export class ShowQuickCommitDetailsCommand extends ActiveEditorCommand {
@@ -12,7 +12,7 @@ export class ShowQuickCommitDetailsCommand extends ActiveEditorCommand {
super(Commands.ShowQuickCommitDetails);
}
async execute(editor: TextEditor, uri?: Uri, sha?: string, commit?: GitCommit, goBackCommand?: CommandQuickPickItem, options: { showFileHistory?: boolean } = { showFileHistory: true }) {
async execute(editor: TextEditor, uri?: Uri, sha?: string, commit?: GitCommit | GitLogCommit, goBackCommand?: CommandQuickPickItem) {
if (!(uri instanceof Uri)) {
if (!editor || !editor.document) return undefined;
uri = editor.document.uri;
@@ -35,72 +35,43 @@ export class ShowQuickCommitDetailsCommand extends ActiveEditorCommand {
sha = blame.commit.isUncommitted ? blame.commit.previousSha : blame.commit.sha;
repoPath = blame.commit.repoPath;
return commands.executeCommand(Commands.ShowQuickFileHistory, uri, undefined, blame.commit);
commit = blame.commit;
}
catch (ex) {
Logger.error('[GitLens.ShowQuickCommitDetails]', `getBlameForLine(${blameline})`, ex);
Logger.error('[GitLens.ShowQuickCommitDetailsCommand]', `getBlameForLine(${blameline})`, ex);
return window.showErrorMessage(`Unable to show commit details. See output channel for more details`);
}
}
try {
let pick: CommitWithFileStatusQuickPickItem | CommandQuickPickItem;
let alreadyPickedCommit = !!commit;
let workingFileName: string;
if (!alreadyPickedCommit) {
let log = await this.git.getLogForRepo(repoPath, sha, 0);
if (!commit || !(commit instanceof GitLogCommit) || commit.type !== 'repo') {
let log = await this.git.getLogForRepo(repoPath, sha, 2);
if (!log) return window.showWarningMessage(`Unable to show commit details`);
commit = Iterables.first(log.commits.values());
pick = await CommitDetailsQuickPick.show(commit as GitLogCommit, uri, goBackCommand);
if (!pick) return undefined;
if (!(pick instanceof CommitWithFileStatusQuickPickItem)) {
return pick.execute();
}
// Attempt to the most recent commit -- so that we can find the real working filename if there was a rename
const workingCommit = await this.git.findMostRecentCommitForFile(pick.uri.fsPath, pick.sha);
// TODO: Leave this at undefined until findMostRecentCommitForFile actually works
workingFileName = !workingCommit ? pick.fileName : undefined;
log = await this.git.getLogForFile(pick.gitUri.fsPath, pick.sha, undefined, undefined, 2);
if (!log) return window.showWarningMessage(`Unable to show commit details`);
commit = Iterables.find(log.commits.values(), c => c.sha === commit.sha);
uri = pick.gitUri || uri;
}
else {
// Attempt to the most recent commit -- so that we can find the real working filename if there was a rename
const workingCommit = await this.git.findMostRecentCommitForFile(commit.uri.fsPath, commit.sha);
// TODO: Leave this at undefined until findMostRecentCommitForFile actually works
workingFileName = !workingCommit ? commit.fileName : undefined;
}
pick = await CommitFileDetailsQuickPick.show(this.git, commit, workingFileName, uri,
// Create a command to get back to where we are right now
new CommandQuickPickItem({
if (!goBackCommand) {
// Create a command to get back to the commit details
goBackCommand = new CommandQuickPickItem({
label: `go back \u21A9`,
description: null
}, Commands.ShowQuickCommitDetails, [new GitUri(commit.uri, commit), sha, commit, goBackCommand, options]),
// If we have already picked a commit, just jump back to the previous (since we skipped a quickpick menu)
// Otherwise setup a normal back command
alreadyPickedCommit
? goBackCommand
: new CommandQuickPickItem({
label: `go back \u21A9`,
description: null
}, Commands.ShowQuickCommitDetails, [new GitUri(commit.uri, commit), sha, undefined, goBackCommand, options]),
{ showFileHistory: options.showFileHistory });
description: `\u00a0 \u2014 \u00a0\u00a0 to repository history`
}, Commands.ShowQuickRepoHistory, [new GitUri(commit.uri, commit)]);
}
const pick = await CommitDetailsQuickPick.show(commit as GitLogCommit, uri, goBackCommand);
if (!pick) return undefined;
if (pick instanceof CommandQuickPickItem) {
if (!(pick instanceof CommitWithFileStatusQuickPickItem)) {
return pick.execute();
}
return undefined;
return commands.executeCommand(Commands.ShowQuickCommitFileDetails, pick.gitUri, pick.sha, undefined,
// Create a command to get back to where we are right now
new CommandQuickPickItem({
label: `go back \u21A9`,
description: `\u00a0 \u2014 \u00a0\u00a0 to details of \u00a0$(git-commit) ${pick.sha}`
}, Commands.ShowQuickCommitDetails, [new GitUri(commit.uri, commit), sha, commit, goBackCommand]));
}
catch (ex) {
Logger.error('[GitLens.ShowQuickCommitDetailsCommand]', ex);

View File

@@ -0,0 +1,89 @@
'use strict';
import { Iterables } from '../system';
import { TextEditor, Uri, window } from 'vscode';
import { ActiveEditorCommand, Commands } from './commands';
import { GitCommit, GitLogCommit, GitProvider, GitUri } from '../gitProvider';
import { Logger } from '../logger';
import { CommandQuickPickItem, CommitFileDetailsQuickPick } from '../quickPicks';
import * as path from 'path';
export class ShowQuickCommitFileDetailsCommand extends ActiveEditorCommand {
constructor(private git: GitProvider) {
super(Commands.ShowQuickCommitFileDetails);
}
async execute(editor: TextEditor, uri?: Uri, sha?: string, commit?: GitCommit | GitLogCommit, goBackCommand?: CommandQuickPickItem, options: { showFileHistory?: boolean } = { showFileHistory: true }) {
if (!(uri instanceof Uri)) {
if (!editor || !editor.document) return undefined;
uri = editor.document.uri;
}
const gitUri = await GitUri.fromUri(uri, this.git);
let repoPath = gitUri.repoPath;
if (!sha) {
if (!editor) return undefined;
const blameline = editor.selection.active.line - gitUri.offset;
if (blameline < 0) return undefined;
try {
const blame = await this.git.getBlameForLine(gitUri.fsPath, blameline, gitUri.sha, gitUri.repoPath);
if (!blame) return window.showWarningMessage(`Unable to show commit file details. File is probably not under source control`);
sha = blame.commit.isUncommitted ? blame.commit.previousSha : blame.commit.sha;
repoPath = blame.commit.repoPath;
commit = blame.commit;
}
catch (ex) {
Logger.error('[GitLens.ShowQuickCommitFileDetailsCommand]', `getBlameForLine(${blameline})`, ex);
return window.showErrorMessage(`Unable to show commit file details. See output channel for more details`);
}
}
try {
if (!commit || ((commit instanceof GitLogCommit) && commit.type !== 'file')) {
let log = await this.git.getLogForFile(uri.fsPath, sha, undefined, undefined, 2);
if (!log) return window.showWarningMessage(`Unable to show commit file details`);
commit = Iterables.find(log.commits.values(), c => c.sha === sha);
}
// Attempt to the most recent commit -- so that we can find the real working filename if there was a rename
const workingCommit = await this.git.findMostRecentCommitForFile(commit.uri.fsPath, commit.sha);
// TODO: Leave this at undefined until findMostRecentCommitForFile actually works
const workingFileName = !workingCommit ? commit.fileName : undefined;
if (!goBackCommand) {
// Create a command to get back to the commit details
goBackCommand = new CommandQuickPickItem({
label: `go back \u21A9`,
description: `\u00a0 \u2014 \u00a0\u00a0 to details of \u00a0$(git-commit) ${sha}`
}, Commands.ShowQuickCommitDetails, [new GitUri(commit.uri, commit), sha, commit]);
}
const pick = await CommitFileDetailsQuickPick.show(this.git, commit, workingFileName, uri, goBackCommand,
// Create a command to get back to where we are right now
new CommandQuickPickItem({
label: `go back \u21A9`,
description: `\u00a0 \u2014 \u00a0\u00a0 to details of \u00a0$(file-text) ${path.basename(commit.fileName)} in \u00a0$(git-commit) ${sha}`
}, Commands.ShowQuickCommitFileDetails, [new GitUri(commit.uri, commit), sha, commit, goBackCommand, options]),
{ showFileHistory: options.showFileHistory });
if (!pick) return undefined;
if (pick instanceof CommandQuickPickItem) {
return pick.execute();
}
return undefined;
}
catch (ex) {
Logger.error('[GitLens.ShowQuickCommitFileDetailsCommand]', ex);
return window.showErrorMessage(`Unable to show commit file details. See output channel for more details`);
}
}
}

View File

@@ -1,9 +1,10 @@
'use strict';
import { commands, TextEditor, Uri, window } from 'vscode';
import { ActiveEditorCommand, Commands } from './commands';
import { GitCommit, GitProvider, GitUri } from '../gitProvider';
import { GitProvider, GitUri } from '../gitProvider';
import { Logger } from '../logger';
import { CommandQuickPickItem, FileHistoryQuickPick } from '../quickPicks';
import * as path from 'path';
export class ShowQuickFileHistoryCommand extends ActiveEditorCommand {
@@ -11,7 +12,7 @@ export class ShowQuickFileHistoryCommand extends ActiveEditorCommand {
super(Commands.ShowQuickFileHistory);
}
async execute(editor: TextEditor, uri?: Uri, maxCount?: number, commit?: GitCommit, goBackCommand?: CommandQuickPickItem) {
async execute(editor: TextEditor, uri?: Uri, maxCount?: number, goBackCommand?: CommandQuickPickItem) {
if (!(uri instanceof Uri)) {
uri = editor && editor.document && editor.document.uri;
}
@@ -27,27 +28,21 @@ export class ShowQuickFileHistoryCommand extends ActiveEditorCommand {
}
try {
if (!commit) {
const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath, undefined, maxCount);
if (!log) return window.showWarningMessage(`Unable to show file history. File is probably not under source control`);
const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath, undefined, maxCount);
if (!log) return window.showWarningMessage(`Unable to show file history. File is probably not under source control`);
let pick = await FileHistoryQuickPick.show(log, uri, maxCount, this.git.config.advanced.maxQuickHistory, goBackCommand);
if (!pick) return undefined;
let pick = await FileHistoryQuickPick.show(log, uri, gitUri.sha, maxCount, this.git.config.advanced.maxQuickHistory, goBackCommand);
if (!pick) return undefined;
if (pick instanceof CommandQuickPickItem) {
return pick.execute();
}
commit = pick.commit;
if (pick instanceof CommandQuickPickItem) {
return pick.execute();
}
return commands.executeCommand(Commands.ShowQuickCommitDetails,
new GitUri(commit.uri, commit),
commit.sha, commit,
return commands.executeCommand(Commands.ShowQuickCommitFileDetails, new GitUri(pick.commit.uri, pick.commit), pick.commit.sha, pick.commit,
new CommandQuickPickItem({
label: `go back \u21A9`,
description: null
}, Commands.ShowQuickFileHistory, [uri, maxCount, undefined, goBackCommand]),
description: `\u00a0 \u2014 \u00a0\u00a0 to history of \u00a0$(file-text) ${path.basename(pick.commit.fileName)}`
}, Commands.ShowQuickFileHistory, [uri, maxCount, goBackCommand]),
{ showFileHistory: false });
}
catch (ex) {

View File

@@ -1,7 +1,7 @@
'use strict';
import { commands, TextEditor, Uri, window } from 'vscode';
import { ActiveEditorCommand, Commands } from './commands';
import { GitCommit, GitProvider, GitUri } from '../gitProvider';
import { GitProvider, GitUri } from '../gitProvider';
import { Logger } from '../logger';
import { CommandQuickPickItem, RepoHistoryQuickPick } from '../quickPicks';
@@ -11,7 +11,7 @@ export class ShowQuickRepoHistoryCommand extends ActiveEditorCommand {
super(Commands.ShowQuickRepoHistory);
}
async execute(editor: TextEditor, uri?: Uri, maxCount?: number, commit?: GitCommit, goBackCommand?: CommandQuickPickItem) {
async execute(editor: TextEditor, uri?: Uri, maxCount?: number, goBackCommand?: CommandQuickPickItem) {
if (!(uri instanceof Uri)) {
uri = editor && editor.document && editor.document.uri;
}
@@ -21,42 +21,24 @@ export class ShowQuickRepoHistoryCommand extends ActiveEditorCommand {
}
try {
let repoPath: string;
if (uri instanceof Uri) {
const gitUri = await GitUri.fromUri(uri, this.git);
repoPath = gitUri.repoPath;
if (!repoPath) {
repoPath = await this.git.getRepoPathFromFile(gitUri.fsPath);
}
}
if (!repoPath) {
repoPath = this.repoPath;
}
const repoPath = await this.git.getRepoPathFromUri(uri, this.repoPath);
if (!repoPath) return window.showWarningMessage(`Unable to show repository history`);
if (!commit) {
const log = await this.git.getLogForRepo(repoPath, undefined, maxCount);
if (!log) return window.showWarningMessage(`Unable to show repository history`);
const log = await this.git.getLogForRepo(repoPath, undefined, maxCount);
if (!log) return window.showWarningMessage(`Unable to show repository history`);
const pick = await RepoHistoryQuickPick.show(log, uri, maxCount, this.git.config.advanced.maxQuickHistory, goBackCommand);
if (!pick) return undefined;
const pick = await RepoHistoryQuickPick.show(log, uri, maxCount, this.git.config.advanced.maxQuickHistory, goBackCommand);
if (!pick) return undefined;
if (pick instanceof CommandQuickPickItem) {
return pick.execute();
}
commit = pick.commit;
if (pick instanceof CommandQuickPickItem) {
return pick.execute();
}
return commands.executeCommand(Commands.ShowQuickCommitDetails,
new GitUri(commit.uri, commit),
commit.sha, undefined,
return commands.executeCommand(Commands.ShowQuickCommitDetails, new GitUri(pick.commit.uri, pick.commit), pick.commit.sha, pick.commit,
new CommandQuickPickItem({
label: `go back \u21A9`,
description: null
}, Commands.ShowQuickRepoHistory, [uri, maxCount, undefined, goBackCommand]));
description: `\u00a0 \u2014 \u00a0\u00a0 to repository history`
}, Commands.ShowQuickRepoHistory, [uri, maxCount, goBackCommand]));
}
catch (ex) {
Logger.error('[GitLens.ShowQuickRepoHistoryCommand]', ex);

View File

@@ -1,7 +1,7 @@
'use strict';
import { TextEditor, Uri, window } from 'vscode';
import { ActiveEditorCommand, Commands } from './commands';
import { GitProvider, GitUri } from '../gitProvider';
import { GitProvider } from '../gitProvider';
import { Logger } from '../logger';
import { CommandQuickPickItem, RepoStatusQuickPick } from '../quickPicks';
@@ -17,19 +17,7 @@ export class ShowQuickRepoStatusCommand extends ActiveEditorCommand {
}
try {
let repoPath: string;
if (uri instanceof Uri) {
const gitUri = await GitUri.fromUri(uri, this.git);
repoPath = gitUri.repoPath;
if (!repoPath) {
repoPath = await this.git.getRepoPathFromFile(gitUri.fsPath);
}
}
if (!repoPath) {
repoPath = this.repoPath;
}
const repoPath = await this.git.getRepoPathFromUri(uri, this.repoPath);
if (!repoPath) return window.showWarningMessage(`Unable to show repository status`);
const statuses = await this.git.getStatusesForRepo(repoPath);