Преглед на файлове

Fixes issue with repository status without changes

main
Eric Amodio преди 7 години
родител
ревизия
00e9660227
променени са 2 файла, в които са добавени 6 реда и са изтрити 3 реда
  1. +1
    -1
      src/commands/quickPickItems.ts
  2. +5
    -2
      src/commands/quickPicks.ts

+ 1
- 1
src/commands/quickPickItems.ts Целия файл

@ -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 = {

+ 5
- 2
src/commands/quickPicks.ts Целия файл

@ -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);
}

Зареждане…
Отказ
Запис