summaryrefslogtreecommitdiff
path: root/lib/resolvers.ml
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2025-06-25 18:12:03 +0200
committerMarius Peter <marius.peter@tutanota.com>2025-06-25 18:12:03 +0200
commitca5c67a40dedf8478b6c4c59f6e21828c4578428 (patch)
tree8e159960743376be15b3a368185a4e11c7a91dc0 /lib/resolvers.ml
parent08a42b99a2ba69e953dc5ffd7e2b429f2f808874 (diff)
Refactor views.
Diffstat (limited to 'lib/resolvers.ml')
-rw-r--r--lib/resolvers.ml7
1 files changed, 3 insertions, 4 deletions
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
Copyright 2019--2025 Marius PETER