last_modified: don't find_blob; find the commit! #10

Merged
reynir merged 2 commits from fix-last_modified into main 2024-12-20 12:11:32 +00:00
Showing only changes of commit d2a0e526da - Show all commits

View file

@ -472,8 +472,10 @@ module Make (Pclock : Mirage_clock.PCLOCK) = struct
~none:Ptime.epoch
~some:Fun.id (Ptime.of_float_s (Int64.to_float (now ()))))
| None, Some head ->
Store.read_exn t.store head >|= function
| Commit c ->
(* See https://github.com/ocaml/ocaml/issues/9301 why we have the
intermediate [r] value. *)
let+ r = Store.read_exn t.store head in
let[@warning "-8"] Commit c = r in
let author = Git_commit.author c in
let secs, tz_offset = author.Git.User.date in
let secs =
@ -491,7 +493,6 @@ module Make (Pclock : Mirage_clock.PCLOCK) = struct
~some:Fun.id (Ptime.of_float_s (Int64.to_float secs))
in
hannes marked this conversation as resolved Outdated

this case shouldn't be needed

this case shouldn't be needed

What do you suggest instead? Mute partial match warnings?

let [@warning "-8"] (`Commit c) = Store.read_exn .. in
..
What do you suggest instead? Mute partial match warnings? ```OCaml let [@warning "-8"] (`Commit c) = Store.read_exn .. in .. ```

yes, as done in let pull

yes, as done in `let pull`

This is done in d2a0e526da. I found that there's no support for infix attributes on binding operators (.e.g let+) so I went with an intermediate binding.

https://github.com/ocaml/ocaml/issues/9301

This is done in d2a0e526dad259f71fc7f741129aba8e476c8f7a. I found that there's no support for infix attributes on binding operators (.e.g `let+`) so I went with an intermediate binding. https://github.com/ocaml/ocaml/issues/9301
Ok ts
| _ -> assert false
let digest t key =
let open Lwt.Infix in