Browse Source

Allows creating a ref quickpick item from git ref

main
Eric Amodio 3 years ago
parent
commit
e215fbb56e
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      src/quickpicks/gitQuickPickItems.ts

+ 8
- 2
src/quickpicks/gitQuickPickItems.ts View File

@ -246,7 +246,7 @@ export interface RefQuickPickItem extends QuickPickItemOfT {
export namespace RefQuickPickItem {
export function create(
ref: string,
ref: string | GitReference,
repoPath: string,
picked?: boolean,
options: { alwaysShow?: boolean; buttons?: QuickInputButton[]; ref?: boolean; icon?: boolean } = {},
@ -279,7 +279,13 @@ export namespace RefQuickPickItem {
};
}
const gitRef = GitReference.create(ref, repoPath);
let gitRef;
if (typeof ref === 'string') {
gitRef = GitReference.create(ref, repoPath);
} else {
gitRef = ref;
ref = gitRef.ref;
}
if (GitRevision.isRange(ref)) {
return {

Loading…
Cancel
Save