mygit

[UNMAINTAINED] A cgit/webgit alternative, written in Rust
Log | Files | Refs | README | LICENSE

commit 539680d61acb8198f03dc7ca621709f309e4c9c2
parent 33401dee4951133fb94eed677c53a510a203ec16
Author: Johann150 <johann@qwertqwefsday.eu>
Date:   Sat, 20 Mar 2021 21:46:50 +0100

remove empty repo template

now that we can handle repos without readme correctly, this is no longer necessary

Diffstat:
Msrc/main.rs | 10----------
Dtemplates/repo-empty.html | 6------
2 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -128,12 +128,6 @@ struct RepoHomeTemplate { readme_text: String, } -#[derive(Template)] -#[template(path = "repo-empty.html")] -struct RepoEmptyTemplate { - repo: Repository, -} - fn repo_from_request(repo_name: &str) -> Result<Repository> { let repo_name = percent_encoding::percent_decode_str(repo_name) .decode_utf8_lossy() @@ -154,10 +148,6 @@ async fn repo_home(req: Request<()>) -> tide::Result { } let repo = repo_from_request(&req.param("repo_name")?)?; - if repo.is_empty().unwrap() { - // we would not be able to find HEAD - return Ok(RepoEmptyTemplate { repo }.into()); - } let mut format = ReadmeFormat::Plaintext; let readme_text = repo diff --git a/templates/repo-empty.html b/templates/repo-empty.html @@ -1,6 +0,0 @@ -{% extends "base.html" %} - -{% block content %} - {% include "repo-navbar.html" %} - <em>(This repository is empty.)</em> -{% endblock %}