Compare two refs !51

merged merged by cmc on 2026-09-06 22:41 UTC · krz/gitbay-ios:compare-refs into main

Discussion

cmc

repo diff <owner/name> <base> <head> reaches the app: pick a base and a head from the repository's branches and tags, see the diff between them. The patch parses with the same UnifiedDiff the merge request and commit screens use, and renders through the existing DiffFileSection — the commit screen already reused it without a merge request model, so nothing in the diff views changed.

The screen reports what the server tells it: the merge base, so a comparison is not against an unstated point, and a visible notice when the patch was truncated, since a diff cut short but rendered whole is the one way this screen could mislead.

Ref loading distinguishes three states — still loading, failed, and a repository that genuinely has no branches or tags — rather than showing an empty picker for all three. A compare carries a generation token, so a slow response for a ref pairing the user has since changed is discarded instead of landing under the new labels.

Closes the compare two refs parity row.