Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

irmin-git: expose Content_addressable type #2329

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 0.26.0
version = 0.26.2
profile = conventional

ocaml-version = 4.08.0
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Unreleased

### Added

- **irmin-git**
- Expose `Content_addressable` type (#2329, @art-w)

### Fixed

- **irmin-client**
Expand Down
8 changes: 5 additions & 3 deletions src/irmin-git/irmin_git.ml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ module Content_addressable (G : Git.S) = struct
let v ?dotgit:_ _root = assert false
end

module type S = Irmin.Content_addressable.S with type key = G.Hash.t
module type S =
Irmin.Content_addressable.S with type _ t = G.t and type key = G.Hash.t

module Maker = Maker_ext (G) (No_sync)

Expand All @@ -125,11 +126,12 @@ module Content_addressable (G : Git.S) = struct
module M = Maker.Make (Schema)
module X = M.Backend.Contents

type 'a t = G.t

let state t =
let+ r = M.repo_of_git (snd t) in
let+ r = M.repo_of_git t in
M.Backend.Repo.contents_t r

type 'a t = bool ref * G.t
type key = X.key
type value = X.value

Expand Down
3 changes: 2 additions & 1 deletion src/irmin-git/irmin_git_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ module type Sigs = sig
(** Use Git as a content-addressable store. Values will be stored into
[.git/objects].*)

module type S = Irmin.Content_addressable.S with type key = G.Hash.t
module type S =
Irmin.Content_addressable.S with type _ t = G.t and type key = G.Hash.t

module Make (V : Irmin.Type.S) : S with type value = V.t
end
Expand Down