MCPcopy Create free account
hub / github.com/Tencent/teamai-cli / cloneUrl

Function cloneUrl

src/providers/gitcode/gitcode-api.ts:162–167  ·  view source on GitHub ↗

* Build the clone URL for the team repo, embedding the PAT as `oauth2: @` * basic-auth so the credential PERSISTS to `.git/config` and later `git push` * (branch + PR flow) authenticates without a separate credential helper. * * This mirrors the GitHub (`x-access-token: @`) and TGit

(repo: string, token: string | null)

Source from the content-addressed store, hash-verified

160 * clone under ~/.teamai/team-repo.
161 */
162function cloneUrl(repo: string, token: string | null): string {
163 if (token) {
164 return `https://oauth2:${token}@${GITCODE_HOST}/${repo}.git`;
165 }
166 return `https://${GITCODE_HOST}/${repo}.git`;
167}
168
169/** Redact an embedded oauth2 token from git output before logging/throwing. */
170function redactCloneOutput(output: string): string {

Callers 1

gitcodeRepoCloneFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected