@page "/git/{Repository}" @inherits GitPage @Repository — git
@if (Info is not { } info) {

No repository called @Repository.

} else {

@info.DisplayName @if (info.Head is { } head) { on @head }

@if (info.Description is { } description) {
about
@description
} @if (info.Owner is { } owner) {
owner
@owner
} @if (Service.CloneUrl(info.Name) is { } clone) {
clone
@clone
} @if (Refs is { } refs) {
refs
@Branches(refs), @Tags(refs)
}
@if (info.Tip is null) {

Nothing committed yet.

} else {

recent commits full log

@foreach (var commit in Recent) { }
@Age(commit.Author.When) @commit.ShortSha @commit.Summary @foreach (var name in commit.Refs) { @name } @commit.Author.Name
} }
@code { private const int Recently = 15; private GitRepoSummary? Info { get; set; } private GitRefsView? Refs { get; set; } private IReadOnlyList Recent { get; set; } = []; protected override void OnParametersSet() { Info = Service.GetRepository(Repository); if (Info is null) { NotFound(); return; } Refs = Service.GetRefs(Repository); Recent = Service.GetLog(Repository, Reference, null, 0, Recently)?.Commits ?? []; } private static string Branches(GitRefsView refs) => refs.Branches.Count == 1 ? "1 branch" : $"{refs.Branches.Count} branches"; private static string Tags(GitRefsView refs) => refs.Tags.Count == 1 ? "1 tag" : $"{refs.Tags.Count} tags"; }