mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-14 17:25:28 -05:00
Fixes issue with repository status without changes
This commit is contained in:
@@ -81,7 +81,7 @@ export class OpenCommitFilesCommandQuickPickItem extends OpenFilesCommandQuickPi
|
||||
export class OpenStatusFilesCommandQuickPickItem extends OpenFilesCommandQuickPickItem {
|
||||
|
||||
constructor(statuses: GitFileStatusItem[], item?: PartialQuickPickItem) {
|
||||
const repoPath = statuses[0].repoPath;
|
||||
const repoPath = statuses.length && statuses[0].repoPath;
|
||||
const fileNames = statuses.map(_ => _.fileName);
|
||||
|
||||
item = {
|
||||
|
||||
@@ -214,7 +214,10 @@ export class RepoStatusesQuickPick {
|
||||
}));
|
||||
}
|
||||
}
|
||||
items.splice(0, 0, new OpenStatusFilesCommandQuickPickItem(statuses.filter(_ => _.status !== GitFileStatus.Deleted)));
|
||||
|
||||
if (statuses.length) {
|
||||
items.splice(0, 0, new OpenStatusFilesCommandQuickPickItem(statuses.filter(_ => _.status !== GitFileStatus.Deleted)));
|
||||
}
|
||||
|
||||
if (goBackCommand) {
|
||||
items.splice(0, 0, goBackCommand);
|
||||
@@ -222,7 +225,7 @@ export class RepoStatusesQuickPick {
|
||||
|
||||
return await window.showQuickPick(items, {
|
||||
matchOnDescription: true,
|
||||
placeHolder: 'Showing the repository status',
|
||||
placeHolder: statuses.length ? 'Repository has changes' : 'Repository has no changes',
|
||||
ignoreFocusOut: getQuickPickIgnoreFocusOut()
|
||||
} as QuickPickOptions);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user