MCPcopy Index your code
hub / github.com/anomalyco/opencode / configureGit

Function configureGit

github/index.ts:653–666  ·  view source on GitHub ↗
(appToken: string)

Source from the content-addressed store, hash-verified

651}
652
653async function configureGit(appToken: string) {
654 // Do not change git config when running locally
655 if (isMock()) return
656
657 console.log("Configuring git...")
658 const config = "http.https://github.com/.extraheader"
659 const ret = await $`git config --local --get ${config}`
660 gitConfig = ret.stdout.toString().trim()
661
662 const newCredentials = Buffer.from(`x-access-token:${appToken}`, "utf8").toString("base64")
663
664 await $`git config --local --unset-all ${config}`
665 await $`git config --local ${config} "AUTHORIZATION: basic ${newCredentials}"`
666}
667
668async function assertGitIdentityConfigured() {
669 const name = (await $`git config --get user.name`.nothrow()).stdout.toString().trim()

Callers 1

index.tsFile · 0.70

Calls 3

isMockFunction · 0.85
logMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected