Commit Graph
2 Commits
Author SHA1 Message Date
Willie 338bc2c2a4 fix(install): harden ref pinning after code review
- Fallback fetch pulled only the default branch because a depth-1 clone
  is single-branch; fetch all heads and tags so an abbreviated SHA off
  the default branch resolves.
- Move the --track guard from CLI flag parsing into InstallTrackedRepo
  so the Web UI is covered too, and reject tags as well as SHAs: both
  leave HEAD detached with nothing for `git pull` to follow.
- An all-hex branch or tag name (e.g. 20240915) was treated as a SHA in
  check and never queried; look the ref up first and fall back to the
  literal SHA only when the remote has no such ref. Full 40-char SHAs
  still skip the network.
- Rename the git package's 7-char shortHash to abbrevHash to avoid
  clashing with install's 12-char helper.

Refs #281
2026-09-21 02:26:55 +08:00
Willie 3000227175 feat(install): support commit SHA and tag pinning via --branch
Teams with supply-chain review need reproducible installs, but --branch
only worked for branch names because git clone --branch rejects SHAs.

Clone the default branch and detach at the pinned commit (targeted
depth-1 fetch, falling back to --unshallow for abbreviated SHAs or
servers that refuse arbitrary wants). Resolve tags in check via
refs/tags and the peeled ^{} commit, and short-circuit SHA pins without
a network round-trip since they can never move. Reject --track with a
SHA: a tracked repo must follow a branch to pull.

Closes #281
2026-09-21 02:07:50 +08:00