Parent
[>]
1//! Route handlers for repository pages. 2//! 3//! Covers two routes: the repository list (`/`) and the repository detail 4//! page (`/{repo}`). The detail handler opens the repository with `gix`, 5//! collects branch and tag summaries by peeling each ref to its commit, and 6//! reads the description from `.git/description`. Refs that cannot be read 7//! are silently skipped rather than treated as fatal errors. 8 9use Template; 10use WebTemplate; 11use State; 12use IntoResponse; 13use Timestamp; 14use ; 15 16use crate; 17use crate; 18 19/// Reads the repository description from `.git/description`, returning `None` 20/// if the file is missing, empty, or contains the default git placeholder text. 21 27 28/// Formats a commit's author date as a `YYYY-MM-DD` string in the commit's 29/// local timezone, returning `None` if the time cannot be parsed. 30 38 39/// Returns `true` if `url` is a relative path that should be rewritten to 40/// point at the raw file serving route. 41 48 49/// Template context for a single branch. 50 56 57/// Template context for a single tag. 58 62 63/// Template context for the repository detail page. 64 65 66 75 76/// Renders the detail page for a single repository, including its branches, 77/// tags, and description. Returns [`Error::RepoNotFound`] if no repository 78/// exists at the given name, or [`Error::GitCorrupt`] if the ref database 79/// cannot be read. 80pub async 199 200/// Template context for a single repository in the list. 201 207 208/// Template context for the repository list page. 209 210 211 214 215/// Renders the repository list page by scanning the root directory for git 216/// repositories. Entries that cannot be opened as a git repository are 217/// skipped. The list is sorted by latest commit first. 218pub async