Skip to content

Commit

Permalink
Merge pull request #2329 from art-w/git-ca-type
Browse files Browse the repository at this point in the history
irmin-git: expose Content_addressable type
  • Loading branch information
art-w authored Sep 19, 2024
2 parents 2f2ad48 + f1c8dc7 commit d5f5245
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
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

0 comments on commit d5f5245

Please sign in to comment.