mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-04 06:29:42 +02:00
`GET /api/system/update/check` answers "is there a newer published release tag?", which is the right question for an npm install but not for a git clone that tracks a branch. Such an install can be many commits behind its own remote while the latest tag says it is current, and nothing surfaces that. Adds `GET /api/system/repo-status`: an informational companion that reports what this CHECKOUT looks like against its own remotes — current branch and commit, ahead/behind counts per remote, the remote's role (tracking / upstream / other), and a bounded list of incoming commits. Read-only and defensive: every git invocation is `execFileSync` with an argv array and a timeout, a non-git or remote-less install reports a structured `error` rather than throwing, and nothing here mutates the working tree or touches the updater's own state. Tests: 24 cases in test/repo-status.test.ts.