Skip to content
Permalink
Browse files

Add git pp for fetch and push

  • Loading branch information...
pascutto committed Oct 10, 2019
1 parent 8099230 commit 51884c4eb01b828dcf7f3f2c6b81ed3af0600d35
Showing with 18 additions and 16 deletions.
  1. +2 −2 irmin-git.opam
  2. +4 −4 irmin-graphql.opam
  3. +1 −1 irmin-mirage-git.opam
  4. +1 −1 irmin-mirage-graphql.opam
  5. +10 −8 src/irmin-git/irmin_git.ml
@@ -18,11 +18,11 @@ depends: [
"ocaml" {>= "4.02.3"}
"dune" {>= "1.1.0"}
"irmin" {= version}
"git" {>= "2.1.0"}
"git" {>= "2.1.1"}
"digestif" {>= "0.7.3"}
"irmin-test" {with-test & =version}
"irmin-mem" {with-test & =version}
"git-unix" {with-test & >= "2.1.0"}
"git-unix" {with-test & >= "2.1.1"}
"mtime" {with-test & >= "1.0.0"}
]

@@ -18,11 +18,11 @@ depends: [
"ocaml" {>= "4.03.0"}
"dune" {>= "1.1.0"}
"irmin" {=version}
"graphql" {>= "0.9"}
"graphql-lwt" {>= "0.9"}
"graphql-cohttp" {>= "0.12.1"}
"graphql" {>= "0.13.0"}
"graphql-lwt" {>= "0.13.0"}
"graphql-cohttp" {>= "0.13.0"}
"cohttp-lwt"
"graphql_parser" {>= "0.11"}
"graphql_parser" {>= "0.13.0"}
]


@@ -17,7 +17,7 @@ depends: [
"dune" {build & >= "1.1.0"}
"irmin-mirage"
"irmin-git" {>= "1.3.0"}
"git-mirage" {>= "1.11.4"}
"git-mirage" {>= "2.1.1"}
"mirage-kv-lwt" {>= "2.0.0"}
]

@@ -16,7 +16,7 @@ build: [
depends: [
"dune" {build & >= "1.1.0"}
"irmin-mirage"
"git-mirage" {>= "1.11.4"}
"git-mirage" {>= "2.1.1"}
"irmin-graphql"
"mirage-clock-lwt"
]
@@ -722,9 +722,6 @@ struct
(* FIXME: need to be exposed in the Git API *)
let reference = git_of_branch br in
let result refs =
(* FIXME: need pp_result *)
Log.debug (fun f ->
f "fetch result: XXX" (* Git.Sync.Result.pp_fetch r *));
let key =
try Some (G.Reference.Map.find reference refs) with Not_found -> None
in
@@ -742,16 +739,15 @@ struct
in
S.fetch_one t e ~reference:references >|= function
| Error e -> Fmt.kstrf (fun e -> Error (`Msg e)) "%a" S.pp_error e
| Ok (`Sync refs) -> result refs
| Ok `AlreadySync -> Ok None
| Ok res -> (
Log.debug (fun f -> f "fetch result: %a" S.pp_fetch_one res);
match res with `Sync refs -> result refs | `AlreadySync -> Ok None )

let push t ?depth:_ e br =
let uri = S.Endpoint.uri e in
Log.debug (fun f -> f "push %a" Uri.pp_hum uri);
let reference = git_of_branch br in
let result refs =
(* FIXME: needs pp_push *)
Log.debug (fun f -> f "push result: XX" (*Git.Sync.Result.pp_push r*));
let errors = ref [] in
List.iter
(function
@@ -773,7 +769,9 @@ struct
in
S.update_and_create t ~references e >|= function
| Error e -> Fmt.kstrf (fun e -> Error (`Msg e)) "%a" S.pp_error e
| Ok r -> result r
| Ok r ->
Log.debug (fun f -> f "push result: %a" S.pp_update_and_create r);
result r
end

type reference =
@@ -1004,6 +1002,10 @@ module No_sync (G : Git.S) = struct

let pp_command _ _ = assert false

let pp_fetch_one _ _ = assert false

let pp_update_and_create _ _ = assert false

let push _ = assert false

let ls _ = assert false

0 comments on commit 51884c4

Please sign in to comment.
You can’t perform that action at this time.