feat: add repository git credential fixer

This commit is contained in:
Agent committed 2026-10-18 10:55:21 +00:00
1 parent 25cea75eb5
commit c6e042db86
7 files changed
+120 -10

No files matched your search

+4 -1
View File
@@ -20,8 +20,11 @@ GitHub and Gitea/Forgejo integration for the DeepSeek Harness (DSH): **clone rep
| `forge_pulls` | list / get / diff / create / comment / merge / close / reopen. |
| `forge_clone` | Clone with account credentials (private repos; SSH URLs switched to HTTPS+token when no SSH key). |
| `forge_push` | Push with the account token (sets upstream; `--force-with-lease` only on request). |
| `forge_fix_credentials` | Configure the local repository’s `.git/config` to use the bundled credential helper, replacing stale or broken local `credential.helper` entries. |
| `forge_api` | Raw authenticated REST call (GitHub `https://api.github.com`, Gitea/Forgejo `/api/v1`). |
`forge_fix_credentials` changes only the target repository’s local config; it does not modify global git configuration or expose tokens. Omit `path` to target the session working directory, or pass a repository path (including a nested path) to update that repository.
Clone and push use a bundled git **credential helper** (`credential-helper.mjs`) passed via `git -c credential.helper=…`; it answers with the token of the gh/tea account whose host matches, and prints nothing otherwise (git falls through to your normal helpers). Your global git config is not modified.
## Requirements
@@ -38,7 +41,7 @@ At least one of `gh` / `tea` must be installed and logged in for the account fea
| File | Role |
| --- | --- |
| `index.js` | Host plugin: HTTP routes under `/git-forge/*` (accounts, repos, auth, ls, clone) and the `forge_*` tools. Injects `webServer`, `connection`, `tools`. |
| `forge.mjs` | Account discovery (gh + tea), REST access, git URL parsing, clone and push. |
| `forge.mjs` | Account discovery (gh + tea), REST access, git URL parsing, clone, push, and repository credential-helper configuration. |
| `auth.mjs` | Drives `gh auth login` / `tea login add` / logout for the settings panel. |
| `credential-helper.mjs` | git credential helper used by clone/push. |
| `client.js` | Web client: clone dialog, local folder picker, accounts settings panel. |