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: fix decoding contents in the middle of a buffer #2277

Merged
merged 4 commits into from
Oct 5, 2023
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
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
Loading