@@ -8,8 +8,12 @@ import { getGitHubApiUri, getRemoteName, useEnterprise } from "~/configuration/c
88import { Protocol } from "~/external/protocol"
99import { type RepositoryPermission , getRepositoryPermission } from "~/git/repository-permissions"
1010import { logDebug , logError } from "~/log"
11- import type { API , GitExtension , RepositoryState } from "~/typings/git"
12- import { RefType } from "~/typings/git"
11+
12+ import { type API , type GitExtension , type RefType , type RepositoryState } from "../typings/git"
13+
14+ // HACK: Workaround for the enum from the git extension not being importable directly
15+ const RefTypeHead = 0 as RefType
16+
1317interface GitHubUrls {
1418 workspaceUri : vscode . Uri
1519 url : string
@@ -48,7 +52,7 @@ export async function getGitHead(): Promise<string | undefined> {
4852 const git = await getGitExtension ( )
4953 if ( git && git . repositories . length > 0 ) {
5054 const head = git . repositories [ 0 ] . state . HEAD
51- if ( head && head . name && head . type === RefType . Head ) {
55+ if ( head && head . name && head . type == RefTypeHead ) {
5256 return `refs/heads/${ head . name } `
5357 }
5458 }
@@ -281,7 +285,7 @@ export function getCurrentBranch(state: RepositoryState | undefined): string | u
281285 return
282286 }
283287
284- if ( head . type != RefType . Head ) {
288+ if ( head . type != RefTypeHead ) {
285289 return
286290 }
287291
0 commit comments