From de51c70a85770fc6679d38a85064f47206fed41c Mon Sep 17 00:00:00 2001 From: Ulugbek Abdullaev Date: Fri, 15 Jan 2021 13:57:51 +0500 Subject: [PATCH] rename 'prelude' to 'uses_git_transport' in 'git push' commands --- src/not-so-smart/push.ml | 6 +++--- src/not-so-smart/push.mli | 2 +- src/not-so-smart/smart_git.ml | 15 +++++++++------ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/not-so-smart/push.ml b/src/not-so-smart/push.ml index fbdd29ca0..3375c65a6 100644 --- a/src/not-so-smart/push.ml +++ b/src/not-so-smart/push.ml @@ -39,12 +39,12 @@ struct pp_error = Flow.pp_error; } - let push ?(prelude = true) ~capabilities:caps cmds ~host path flow store - access push_cfg pack = + let push ?(uses_git_transport = true) ~capabilities:caps cmds ~host path flow + store access push_cfg pack = let fiber ctx = let open Smart in let* () = - if prelude then + if uses_git_transport then send ctx proto_request (Proto_request.receive_pack ~host ~version:1 path) else return () diff --git a/src/not-so-smart/push.mli b/src/not-so-smart/push.mli index 9ee4c06a1..1c8cc5d99 100644 --- a/src/not-so-smart/push.mli +++ b/src/not-so-smart/push.mli @@ -11,7 +11,7 @@ module Make (Uid : UID) (Ref : REF) : sig val push : - ?prelude:bool -> + ?uses_git_transport:bool -> capabilities:Smart.Capability.t list -> [ `Create of Ref.t | `Delete of Ref.t | `Update of Ref.t * Ref.t ] list -> host:[ `Addr of Ipaddr.t | `Domain of [ `host ] Domain_name.t ] -> diff --git a/src/not-so-smart/smart_git.ml b/src/not-so-smart/smart_git.ml index bad3ff1f2..53fe635ce 100644 --- a/src/not-so-smart/smart_git.ml +++ b/src/not-so-smart/smart_git.ml @@ -554,12 +554,12 @@ struct Lwt.async fiber; stream - let push ?prelude ~ctx ~capabilities path cmds endpoint store access push_cfg - pack = + let push ?uses_git_transport ~ctx ~capabilities path cmds endpoint store + access push_cfg pack = let open Lwt.Infix in Mimic.resolve ctx >>? fun flow -> - Push.push ?prelude ~capabilities cmds ~host:endpoint path (Flow.make flow) - store access push_cfg pack + Push.push ?uses_git_transport ~capabilities cmds ~host:endpoint path + (Flow.make flow) store access push_cfg pack >>= fun () -> Mimic.close flow >>= fun () -> Lwt.return_ok () @@ -568,12 +568,15 @@ struct let open Rresult in match version, edn.Endpoint.scheme with | `V1, ((`Git | `SSH _) as scheme) -> - let prelude = match scheme with `Git -> true | `SSH _ -> false in + let uses_git_transport = + match scheme with `Git -> true | `SSH _ -> false + in let host = edn.host in let path = edn.path in let push_cfg = Nss.Push.configuration () in let run () = - push ~prelude ~ctx ~capabilities path cmds host store access push_cfg + push ~uses_git_transport ~ctx ~capabilities path cmds host store + access push_cfg (pack ~light_load ~heavy_load) in Lwt.catch run (function