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 ; 15 16use crateResult; 17use crate; 18use crate; 19 20/// Reads the repository description from `.git/description`, returning `None` 21/// if the file is missing, empty, or contains the default git placeholder text. 22 28 29/// Returns `true` if `url` is a relative path that should be rewritten to 30/// point at the raw file serving route. 31 38 39/// Template context for a single branch. 40 47 48/// Template context for a single tag. 49 54 55/// Template context for the repository detail page. 56 57 58 69 70/// Renders the detail page for a single repository, including its branches, 71/// tags, and description. Returns [`Error::RepoNotFound`] if no repository 72/// exists at the given name, or [`Error::GitCorrupt`] if the ref database 73/// cannot be read. 74 75pub 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