* 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)
| 160 | * clone under ~/.teamai/team-repo. |
| 161 | */ |
| 162 | function 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. */ |
| 170 | function redactCloneOutput(output: string): string { |