diff options
| author | Marius Peter <marius.peter@tutanota.com> | 2025-06-28 12:12:04 +0200 | 
|---|---|---|
| committer | Marius Peter <marius.peter@tutanota.com> | 2025-06-28 12:12:04 +0200 | 
| commit | 5e33ec0924d4c13ff1db3c05a0ae732beedfd85a (patch) | |
| tree | a36c59ce7ee824fedfd7e35efbdc339d278b8a08 /lib | |
| parent | 05797c614c89e30288746fa4939e8dd97a508617 (diff) | |
Fix tree view at HEAD.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/resolvers.ml | 11 | 
1 files changed, 6 insertions, 5 deletions
| diff --git a/lib/resolvers.ml b/lib/resolvers.ml index fb5dee6..fa485e3 100644 --- a/lib/resolvers.ml +++ b/lib/resolvers.ml @@ -126,11 +126,12 @@ module Tree = struct    let head repo =      let* store = store repo in -    let* hash = -      Store.Ref.resolve store Git.Reference.head -      |> Lwt_result.map Store.Hash.to_hex -    in -    of_id repo hash +    let* commit_hash = Store.Ref.resolve store Git.Reference.head in +    Lwt_result.bind (Store.read store commit_hash) @@ function +    | Git.Value.Commit commit -> +        let tree_id = Store.Value.Commit.tree commit |> Store.Hash.to_hex in +        of_id repo tree_id +    | _ -> Lwt_result.fail @@ `Msg "HEAD reference does not point to a commit"  end  module Blob = struct | 
