From a8ab45f2bec5ca0d07edf5215e9ce31a57a9895d Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Wed, 15 Mar 2023 11:43:36 +0100 Subject: [PATCH 1/2] Add the branch accessor --- src/git_kv.ml | 2 ++ src/git_kv.mli | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/git_kv.ml b/src/git_kv.ml index 854e1e6..d46fec2 100644 --- a/src/git_kv.ml +++ b/src/git_kv.ml @@ -107,6 +107,8 @@ let connect ctx endpoint = let _r = to_invalid r in Lwt.return t +let branch t = t.branch + type key = Mirage_kv.Key.t type change = [ diff --git a/src/git_kv.mli b/src/git_kv.mli index 77d2eb7..97c456a 100644 --- a/src/git_kv.mli +++ b/src/git_kv.mli @@ -40,6 +40,8 @@ val connect : Mimic.ctx -> string -> t Lwt.t @raise [Invalid_argument _] if we can not initialize the store, or if we can not fetch the given [remote]. *) +val branch : t -> Git.Reference.t + val to_octets : t -> string Lwt.t (** [to_octets store] returns a serialized version of the given [store]. *) From 999e9d696816bac9bc3c38054af94710f279bed1 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Wed, 15 Mar 2023 11:45:17 +0100 Subject: [PATCH 2/2] Add the documentation about Git_kv.branch --- src/git_kv.mli | 1 + 1 file changed, 1 insertion(+) diff --git a/src/git_kv.mli b/src/git_kv.mli index 97c456a..bfc0020 100644 --- a/src/git_kv.mli +++ b/src/git_kv.mli @@ -41,6 +41,7 @@ val connect : Mimic.ctx -> string -> t Lwt.t we can not fetch the given [remote]. *) val branch : t -> Git.Reference.t +(** [branch t] returns the branch used by the given [t]. *) val to_octets : t -> string Lwt.t (** [to_octets store] returns a serialized version of the given [store]. *)