From ca5c67a40dedf8478b6c4c59f6e21828c4578428 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Wed, 25 Jun 2025 18:12:03 +0200 Subject: Refactor views. --- lib/resolvers.ml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/resolvers.ml') diff --git a/lib/resolvers.ml b/lib/resolvers.ml index f7bf31a..0beb675 100644 --- a/lib/resolvers.ml +++ b/lib/resolvers.ml @@ -122,10 +122,9 @@ module Tree = struct let of_id repo id = let* store = store repo in let hash = Store.Hash.of_hex id in - Store.read store hash - |> Lwt_result.map @@ function - | Git.Value.Tree tree -> to_t tree - | _ -> failwith "no head tree id" + Lwt_result.bind (Store.read store hash) @@ function + | Git.Value.Tree tree -> to_t tree |> Lwt_result.return + | _ -> `Msg "no head tree id" |> Lwt_result.fail let head repo : (t, Store.error) Lwt_result.t = let* store = store repo in -- cgit v1.2.3