summaryrefslogtreecommitdiff
path: root/lib/views/repo_root.ml
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2025-02-01 19:24:32 +0100
committerMarius Peter <marius.peter@tutanota.com>2025-02-01 19:24:32 +0100
commit6e8e49ba49beeeb63e1e027fc23e8883a1185109 (patch)
tree6a816fc986c6650959087f88e7fd63997efe003c /lib/views/repo_root.ml
parent19875b1503f6e890975e50bdd88853b6e4d0caf4 (diff)
Reorganized everything.
Thank you DeepSeek!
Diffstat (limited to 'lib/views/repo_root.ml')
-rw-r--r--lib/views/repo_root.ml41
1 files changed, 0 insertions, 41 deletions
diff --git a/lib/views/repo_root.ml b/lib/views/repo_root.ml
deleted file mode 100644
index dd391d8..0000000
--- a/lib/views/repo_root.ml
+++ /dev/null
@@ -1,41 +0,0 @@
-open Dream_html
-open HTML
-open Git_unix
-
-let git_directory = Filename.concat (Unix.getenv "HOME") "git"
-
-let err_to_string err = Fmt.to_to_string Store.pp_error err
-
-let get_head_commit repo_path =
- Lwt_main.run (
- let open Lwt.Infix in
- match Git.Reference.of_string "HEAD" with
- | Error err ->
- Lwt.return (Error ("Invalid HEAD reference string: " ^ err_to_string err))
- | Ok head_ref_name ->
- Store.v (Fpath.v repo_path) >>= function
- | Error err ->
- Lwt.return (Error ("Failed to open repository: " ^ err_to_string err))
- | Ok store ->
- Store.Ref.resolve store head_ref_name >>= function
- | Error err ->
- Lwt.return (Error ("Failed to resolve HEAD: " ^ err_to_string err))
- | Ok head_oid -> Lwt.return (Ok head_oid)
- (* Git.Commit.v store head_oid >>= function *)
- (* | Error err -> *)
- (* Lwt.return (Error ("Failed to get commit from hash: " ^ err_to_string err)) *)
- (* | Ok commit -> *)
- (* Lwt.return (Ok commit) *)
- )
-
-let main_content =
- let open Lwt.Infix in
- Lwt.async (fun _ ->
- get_head_commit git_directory >>= function
- | Error msg ->
- Lwt.map (fun content -> [ p [] [ txt content ]]) (Error msg)
- | Ok head_oid ->
- Lwt.map (fun content -> [ p [] [ txt "HEAD commit hash: %s" content ]]) (Store.Hash.to_string head_oid)
- )
-
-let render = Layouts.application ~page_title:"My repositories" ~main_content
Copyright 2019--2025 Marius PETER