diff --git a/src/not-so-smart/decoder.ml b/src/not-so-smart/decoder.ml index 74680cfd4..44555807c 100644 --- a/src/not-so-smart/decoder.ml +++ b/src/not-so-smart/decoder.ml @@ -150,9 +150,6 @@ let at_least_one_line decoder = let pkt_len_unsafe (decoder : decoder) = let hex = Bytes.of_string "0x0000" in Bytes.blit decoder.buffer decoder.pos hex 2 4; - Log.debug (fun m -> - m "hex: %s buffer: %s" (Bytes.to_string hex) - (Bytes.to_string decoder.buffer)); int_of_string (Bytes.unsafe_to_string hex) (* no header *) diff --git a/src/not-so-smart/fetch.ml b/src/not-so-smart/fetch.ml index d8f5be3c9..2513ade9e 100644 --- a/src/not-so-smart/fetch.ml +++ b/src/not-so-smart/fetch.ml @@ -152,20 +152,17 @@ struct (Proto_vals_v2.Proto_request.upload_pack ~host ~version:2 path)) else return () in - let* server_caps = - Wire_proto_v2.(recv ctx Witness.Capability_advertisement) - in - return server_caps + Wire_proto_v2.(recv ctx Witness.Capability_advertisement) let get_server_capabilities ?(uses_git_transport = false) ~host ~path ctx flow = - let get_caps = + let get_caps ctx = let ( let* ) = Wire_proto_v2.( let* ) in let* caps = connect ~uses_git_transport ~host ~path ctx in let* () = Wire_proto_v2.send ctx Flush () in Wire_proto_v2.return caps in - State_flow.run sched fail io flow get_caps |> prj + State_flow.run sched fail io flow (get_caps ctx) |> prj (* let connect ?(uses_git_transport = false) ~host path flow access = Wire_proto_v2_flow *) diff --git a/src/not-so-smart/proto_vals_v2.ml b/src/not-so-smart/proto_vals_v2.ml index 31b83486f..ceade4de7 100644 --- a/src/not-so-smart/proto_vals_v2.ml +++ b/src/not-so-smart/proto_vals_v2.ml @@ -184,7 +184,7 @@ module Decoder = struct value = 1*(ALPHA | DIGIT | " -_.,?\/{}[]()<>!@#$%^&*+=:;") *) let decode_capability_ads decoder = (* protocol-version *) - skip_string "version 2" decoder >>= fun () -> + prompt_pkt (skip_string "version 2") decoder >>= fun () -> let expected = `Pkt [ `Str "key[=value] LF" ] in (* capability-list diff --git a/test/smart/test.ml b/test/smart/test.ml index 49837f237..d95ae6b4e 100644 --- a/test/smart/test.ml +++ b/test/smart/test.ml @@ -1685,11 +1685,14 @@ module Proto_v2 = struct in let path = "not-found.git" in let proto_ctx = Wire_proto_v2.Context.make ~client_caps:[] in - let* run = + let* capabilities = Fetch.V2.get_server_capabilities ~uses_git_transport:false ~host ~path proto_ctx flow in - assert (not (List.length run = 0)); + Alcotest.(check bool) + "capability list is not empty" + (List.length capabilities > 0) + true; Lwt.return () end