ソースを参照

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

読み込み中…
キャンセル
保存