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; 13 14use crate; 15use crate; 16 17/// Reads the repository description from `.git/description`, returning `None` 18/// if the file is missing, empty, or contains the default git placeholder text. 19 25 26/// Returns `true` if `url` is a relative path that should be rewritten to 27/// point at the raw file serving route. 28 35 36/// Template context for a single branch. 37 44 45/// Template context for a single tag. 46 51 52/// Template context for the repository detail page. 53 54 55 66 67/// Renders the detail page for a single repository, including its branches, 68/// tags, and description. Returns [`Error::RepoNotFound`] if no repository 69/// exists at the given name, or [`Error::GitCorrupt`] if the ref database 70/// cannot be read. 71pub async 228 229/// Template context for a single repository in the list. 230 236 237/// Template context for the repository list page. 238 239 240 243 244/// Renders the repository list page by scanning the root directory for git 245/// repositories. Entries that cannot be opened as a git repository are 246/// skipped. The list is sorted by latest commit first. 247pub async