Something went wrong. Try again.
A local Git merge queue with content-bound gate verdicts
Something went wrong. Try again.
466 B · 18 lines
OCaml
at main
12345678910111213141516171819type t = Git.Hash.t
let of_hash h = h
let of_hex s = match Git.Hash.of_hex s with | h -> Some h | exception Invalid_argument _ -> None
let to_hex = Git.Hash.to_hexlet short c = String.sub (to_hex c) 0 12let equal = Git.Hash.equallet compare = Git.Hash.comparelet pp ppf c = Fmt.string ppf (to_hex c)
let codec = Json.Codec.of_of_string ~kind:"commit" ~enc:to_hex (fun s -> Option.to_result ~none:(Fmt.str "%S is not a commit id" s) (of_hex s))