|
@ -563,7 +563,7 @@ export async function* pickBranchesStep< |
|
|
|
|
|
|
|
|
export async function* pickBranchOrTagStep< |
|
|
export async function* pickBranchOrTagStep< |
|
|
State extends PartialStepState & { repo: Repository }, |
|
|
State extends PartialStepState & { repo: Repository }, |
|
|
Context extends { repos: Repository[]; showTags?: boolean; title: string }, |
|
|
|
|
|
|
|
|
Context extends { repos: Repository[]; pickCommitForItem?: boolean; showTags?: boolean; title: string }, |
|
|
>( |
|
|
>( |
|
|
state: State, |
|
|
state: State, |
|
|
context: Context, |
|
|
context: Context, |
|
@ -591,7 +591,10 @@ export async function* pickBranchOrTagStep< |
|
|
|
|
|
|
|
|
const getBranchesAndOrTagsFn = async () => { |
|
|
const getBranchesAndOrTagsFn = async () => { |
|
|
return getBranchesAndOrTags(state.repo, context.showTags ? ['branches', 'tags'] : ['branches'], { |
|
|
return getBranchesAndOrTags(state.repo, context.showTags ? ['branches', 'tags'] : ['branches'], { |
|
|
buttons: [QuickCommandButtons.RevealInSideBar], |
|
|
|
|
|
|
|
|
buttons: |
|
|
|
|
|
typeof context.pickCommitForItem === 'boolean' |
|
|
|
|
|
? [QuickCommandButtons.PickCommit, QuickCommandButtons.RevealInSideBar] |
|
|
|
|
|
: [QuickCommandButtons.RevealInSideBar], |
|
|
filter: filter, |
|
|
filter: filter, |
|
|
picked: picked, |
|
|
picked: picked, |
|
|
sort: true, |
|
|
sort: true, |
|
@ -616,6 +619,11 @@ export async function* pickBranchOrTagStep< |
|
|
: branchesAndOrTags, |
|
|
: branchesAndOrTags, |
|
|
additionalButtons: [...(additionalButtons ?? []), showTagsButton], |
|
|
additionalButtons: [...(additionalButtons ?? []), showTagsButton], |
|
|
onDidClickItemButton: (quickpick, button, { item }) => { |
|
|
onDidClickItemButton: (quickpick, button, { item }) => { |
|
|
|
|
|
if (button === QuickCommandButtons.PickCommit) { |
|
|
|
|
|
context.pickCommitForItem = true; |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (button === QuickCommandButtons.RevealInSideBar) { |
|
|
if (button === QuickCommandButtons.RevealInSideBar) { |
|
|
if (GitReference.isBranch(item)) { |
|
|
if (GitReference.isBranch(item)) { |
|
|
void GitActions.Branch.reveal(item, { select: true, expand: true }); |
|
|
void GitActions.Branch.reveal(item, { select: true, expand: true }); |
|
@ -625,6 +633,7 @@ export async function* pickBranchOrTagStep< |
|
|
void GitActions.Commit.reveal(item, { select: true, expand: true }); |
|
|
void GitActions.Commit.reveal(item, { select: true, expand: true }); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
return false; |
|
|
}, |
|
|
}, |
|
|
onDidClickButton: async (quickpick, button) => { |
|
|
onDidClickButton: async (quickpick, button) => { |
|
|
if (button === showTagsButton) { |
|
|
if (button === showTagsButton) { |
|
|