diff options
Diffstat (limited to '')
-rw-r--r-- | pkgs/by-name/ba/back/src/web/issue/mod.rs (renamed from pkgs/by-name/ba/back/src/issues/issue/mod.rs) | 15 | ||||
-rw-r--r-- | pkgs/by-name/ba/back/src/web/issue/raw.rs (renamed from pkgs/by-name/ba/back/src/issues/issue/raw.rs) | 2 | ||||
-rw-r--r-- | pkgs/by-name/ba/back/src/web/issue_show.rs (renamed from pkgs/by-name/ba/back/src/issues/issue_show.rs) | 0 |
3 files changed, 11 insertions, 6 deletions
diff --git a/pkgs/by-name/ba/back/src/issues/issue/mod.rs b/pkgs/by-name/ba/back/src/web/issue/mod.rs index b78f473..79ef70f 100644 --- a/pkgs/by-name/ba/back/src/issues/issue/mod.rs +++ b/pkgs/by-name/ba/back/src/web/issue/mod.rs @@ -16,7 +16,7 @@ use gix::{bstr::ByteSlice, Commit, Id, ObjectId, Repository}; use raw::{Operation, RawIssue}; use rocket::response::content::RawHtml; -use crate::SOURCE_CODE_REPOSITORY; +use crate::config::BackConfig; use super::format::{BackString, Markdown}; @@ -114,12 +114,17 @@ impl<'a> Issue<'a> { pub fn from_commit_id(repo: &'a Repository, commit_id: ObjectId) -> Self { fn unwrap_id<'b>(repo: &Repository, id: &Commit<'b>) -> (RawIssue, Id<'b>) { let tree_obj = repo - .find_object(id.tree_id().unwrap()) + .find_object( + id.tree_id() + .expect("All of git-bug's commits should have trees attached to them'"), + ) .expect("The object with this id should exist.") .try_into_tree() .expect("The git-bug's data model enforces this."); - let ops_ref = tree_obj.find_entry("ops").unwrap(); + let ops_ref = tree_obj + .find_entry("ops") + .expect("All of git-bug's trees should contain a 'ops' json file"); let issue_data = repo .find_object(ops_ref.object_id()) @@ -237,7 +242,7 @@ impl<'a> Issue<'a> { )) } - pub fn to_html(&self) -> RawHtml<String> { + pub fn to_html(&self, config: &BackConfig) -> RawHtml<String> { let fmt_comments: String = self .comments .iter() @@ -325,7 +330,7 @@ impl<'a> Issue<'a> { </body> </html> "#, - SOURCE_CODE_REPOSITORY.get().expect("This should be set") + config.source_code_repository_url )) } } diff --git a/pkgs/by-name/ba/back/src/issues/issue/raw.rs b/pkgs/by-name/ba/back/src/web/issue/raw.rs index 48d2a9f..bb447ec 100644 --- a/pkgs/by-name/ba/back/src/issues/issue/raw.rs +++ b/pkgs/by-name/ba/back/src/web/issue/raw.rs @@ -13,7 +13,7 @@ use gix::{bstr::ByteSlice, Repository}; use serde::Deserialize; use serde_json::Value; -use crate::issues::format::BackString; +use crate::web::format::BackString; use super::{Author, Status}; diff --git a/pkgs/by-name/ba/back/src/issues/issue_show.rs b/pkgs/by-name/ba/back/src/web/issue_show.rs index 638840e..638840e 100644 --- a/pkgs/by-name/ba/back/src/issues/issue_show.rs +++ b/pkgs/by-name/ba/back/src/web/issue_show.rs |