Skip to content

Commit

Permalink
Merge pull request 'add function: commit : t -> Digestif.SHA1.t optio…
Browse files Browse the repository at this point in the history
…n' (!6) from add-commit into main

Reviewed-on: https://git.robur.coop/robur/git-kv/pulls/6
Reviewed-by: dinosaure <[email protected]>
  • Loading branch information
hannesm committed Nov 28, 2024
2 parents 992127f + 56eceb1 commit 60795e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/git_kv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ let connect ctx endpoint =

let branch t = t.branch

let commit t = t.head

type key = Mirage_kv.Key.t

type change = [
Expand Down
3 changes: 3 additions & 0 deletions src/git_kv.mli
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ val connect : Mimic.ctx -> string -> t Lwt.t
val branch : t -> Git.Reference.t
(** [branch t] returns the branch used by the given [t]. *)

val commit : t -> Digestif.SHA1.t option
(** [commit t] returns the commit used by the given [t]. *)

val to_octets : ?level:int -> t -> string Lwt_stream.t
(** [to_octets ?level store] returns a serialized version of the given [store].
[level] is the {i zlib} level compression used for Git object (between [0]
Expand Down

0 comments on commit 60795e6

Please sign in to comment.