[OCaml] Mobile-friendly clone of cgit.
Fix tree view at HEAD.
lib/resolvers.ml
@@ -126,11 +126,12 @@
126
126
127
127
let head repo =
128
128
let* store = store repo in
129
Removed:
let* hash =
130
Removed:
Store.Ref.resolve store Git.Reference.head
131
Removed:
|> Lwt_result.map Store.Hash.to_hex
132
Removed:
in
133
Removed:
of_id repo hash
129
Added:
let* commit_hash = Store.Ref.resolve store Git.Reference.head in
130
Added:
Lwt_result.bind (Store.read store commit_hash) @@ function
131
Added:
| Git.Value.Commit commit ->
132
Added:
let tree_id = Store.Value.Commit.tree commit |> Store.Hash.to_hex in
133
Added:
of_id repo tree_id
134
Added:
| _ -> Lwt_result.fail @@ `Msg "HEAD reference does not point to a commit"
134
135
end
135
136
136
137
module Blob = struct