Skip to content

Commit

Permalink
rename 'prelude' to 'uses_git_transport' in 'git push' commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ulugbekna committed Jan 18, 2021
1 parent 906ae7b commit de51c70
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/not-so-smart/push.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down
2 changes: 1 addition & 1 deletion src/not-so-smart/push.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] ->
Expand Down
15 changes: 9 additions & 6 deletions src/not-so-smart/smart_git.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

Expand All @@ -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
Expand Down

0 comments on commit de51c70

Please sign in to comment.