Commit Graph

5 Commits

Author SHA1 Message Date
ZhenYi
afb1bbeb71 fix(service): use default_branch for graph and reflog endpoints
Some checks are pending
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
- git_commit_graph: use default_branch when rev is None
- git_commit_graph_react: use default_branch when rev is None
- git_commit_reflog: fall back to default_branch when HEAD is detached

Fixes errors:
- reference 'refs/heads/master' not found (graph-react endpoint)
- HEAD has no name (reflog endpoint when HEAD is detached)
2026-04-17 16:36:44 +08:00
ZhenYi
82ed726848 fix(git): convert default_branch to full ref name (refs/heads/*)
The database stores short branch names (e.g., "main"), but git2's push_ref()
requires full reference names (e.g., "refs/heads/main"). This fixes all
service-layer endpoints to convert default_branch to the full ref format.

Fixed endpoints:
- git_readme: convert to refs/heads/{branch}
- git_commit_count: convert to refs/heads/{branch}
- git_contributors: convert to refs/heads/{branch}
- git_commit_log: convert to refs/heads/{branch}
- git_commit_walk: convert to refs/heads/{branch}

Resolves errors:
- Internal("the given reference name 'main' is not valid")
2026-04-17 15:56:08 +08:00
ZhenYi
4c49953572 fix(git): use default_branch in git_commit_log and update API docs
Some checks are pending
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
- git_commit_log: default to repo.default_branch when rev is None
- Update API documentation to reflect default_branch instead of HEAD
2026-04-17 15:16:18 +08:00
ZhenYi
2bd1339d6c fix(git): use repo.default_branch instead of HEAD to avoid master/branch mismatch
Some checks are pending
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
- Add #[serde(default)] to MergeAnalysisQuery.their_oid and MergeRefAnalysisQuery fields
  since they come from path parameters, not query strings
- git_readme/git_commit_count/git_contributors: default to repo.default_branch
  instead of HEAD to avoid errors when HEAD points to refs/heads/master but
  the actual default branch is main
2026-04-17 15:13:08 +08:00
ZhenYi
93cfff9738 init 2026-04-15 09:08:09 +08:00