Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Commit 4dd5989

Browse files
avsmdjs55
authored andcommitted
irmin: port to the 1.4.0 interfaces
Signed-off-by: Anil Madhavapeddy <[email protected]>
1 parent 485f21f commit 4dd5989

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

api/ocaml/git/datakit_client_git.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ let tree t h =
656656
match S.Tree.Hash.of_string h with
657657
| Error e -> Lwt.return (Error (e :> error))
658658
| Ok hash ->
659-
S.Tree.of_hash t.repo hash >|= function
659+
S.Tree.of_hash t.repo (`Node hash) >|= function
660660
| None -> err_msg "%s is not a valid tree" h
661661
| Some x -> Ok x
662662

datakit.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ depends: [
1717
"asetmap"
1818
"git" {>= "1.11.5"}
1919
"uri" {>="2.0.0"}
20-
"irmin" {>= "1.2.0" & < "1.4.0"}
20+
"irmin" {>="1.4.0"}
2121
"irmin-mem" {>= "1.2.0"}
2222
"irmin-git" {>= "1.2.0"}
2323
"cstruct" {>= "2.2"}

src/datakit/datakit.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,9 @@ module Vfs (Store : Store.S) = struct
643643
| Some (`Contents (f, `Exec)) -> hash f >|= Fmt.strf "X-%a\n" pp_hash
644644
| Some (`Contents (f, `Link)) -> hash f >|= Fmt.strf "L-%a\n" pp_hash
645645
| Some (`Node _ as dir) ->
646-
Store.Tree.hash repo dir >|= fun h ->
647-
Fmt.strf "D-%a\n" Store.Tree.Hash.pp h
646+
Store.Tree.hash repo dir >|= function
647+
| `Node n -> Fmt.strf "D-%a\n" Store.Tree.Hash.pp n
648+
| `Contents (c,m) -> Fmt.strf "D-%a\n" Store.Contents.Hash.pp c
648649

649650
let watch_tree_stream store ~path ~init =
650651
let session = Vfs.File.Stream.session init in
@@ -880,7 +881,7 @@ module Vfs (Store : Store.S) = struct
880881
Ok (Vfs.File.ro_of_string ~perm data |> Vfs.Inode.file name)
881882
end
882883
| `Node hash ->
883-
Store.Tree.of_hash repo hash >|= function
884+
Store.Tree.of_hash repo (`Node hash) >|= function
884885
| None -> Vfs.Error.no_entry
885886
| Some data ->
886887
Ok (ro_tree ~name:"ro" ~get_root:(fun () -> Lwt.return data))

0 commit comments

Comments
 (0)