Skip to content

Commit

Permalink
Merge pull request #2277 from metanivek/irmin-git/fix-decoding
Browse files Browse the repository at this point in the history
irmin-git: fix decoding contents in the middle of a buffer
  • Loading branch information
art-w authored Oct 5, 2023
2 parents 2e7a6a2 + 39d14fe commit fddb6f0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
the maintenance of that part of the code, as ensuring the correct order of
cached IO operations was tricky for stream proofs (#2275, @samoht)

### Changed

- **irmin-git**
- Moved lower bounds to `git.3.14.0` to use new function (#2277, @metanivek)

## 3.8.0 (2023-07-06)

### Added
Expand Down
7 changes: 6 additions & 1 deletion examples/server/config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)

module Store = Irmin_mem.KV.Make (Irmin.Contents.String)
module Store = struct
module Git_impl = Irmin_git.Mem
module Sync = Git.Mem.Sync (Git_impl)
module Maker = Irmin_git.KV (Git_impl) (Sync)
include Maker.Make (Irmin.Contents.String)
end

let uri = Uri.of_string "tcp://localhost:4242"
4 changes: 2 additions & 2 deletions irmin-git.opam
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ depends: [
"dune" {>= "2.9.0"}
"irmin" {= version}
"ppx_irmin" {= version}
"git" {>= "3.7.0"}
"git-unix" {>= "3.7.0"}
"git" {>= "3.14.0"}
"git-unix" {>= "3.14.0"}
"digestif" {>= "0.9.0"}
"cstruct"
"fmt"
Expand Down
7 changes: 4 additions & 3 deletions src/irmin-git/contents.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ module Make (G : Git.S) (C : Irmin.Contents.S) = struct
match Raw.of_raw_with_header ~off buf with
| Ok g -> (
match V.of_git g with
| Some g ->
pos_ref := String.length buf;
g
| Some v ->
let len = Raw.length_with_header g |> Int64.to_int in
pos_ref := off + len;
v
| None -> failwith "wrong object kind")
| Error (`Msg _) -> failwith "wrong object"

Expand Down

0 comments on commit fddb6f0

Please sign in to comment.