summaryrefslogtreecommitdiff
path: root/lib/resolvers.ml
diff options
context:
space:
mode:
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