Skip to content

Commit 81c1e5d

Browse files
committed
Fixes tags showing when include is just branches
1 parent 89c0e6c commit 81c1e5d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/quickpicks/referencePicker.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,17 @@ export async function showReferencePicker2(
203203
async function getItems(repoPath: string, options?: ReferencesQuickPickOptions): Promise<ReferencesQuickPickItem[]> {
204204
const include = options?.include ?? ReferencesQuickPickIncludes.BranchesAndTags;
205205

206+
const includes: ('branches' | 'tags')[] = [];
207+
if (include & ReferencesQuickPickIncludes.Branches) {
208+
includes.push('branches');
209+
}
210+
if (include & ReferencesQuickPickIncludes.Tags) {
211+
includes.push('tags');
212+
}
213+
206214
const items: ReferencesQuickPickItem[] = await getBranchesAndOrTags(
207215
Container.instance.git.getRepository(repoPath),
208-
include && ReferencesQuickPickIncludes.BranchesAndTags
209-
? ['branches', 'tags']
210-
: include && ReferencesQuickPickIncludes.Branches
211-
? ['branches']
212-
: include && ReferencesQuickPickIncludes.Tags
213-
? ['tags']
214-
: [],
216+
includes,
215217
{
216218
buttons: [RevealInSideBarQuickInputButton],
217219
filter: options?.filter,

0 commit comments

Comments
 (0)