Branch Coverage

deps/libgit2/src/libgit2/transports/http.c
Criterion Covered Total %
branch 0 188 0.0


line true false branch
110 0 0 GIT_ASSERT_ARG(username);
112 0 0 if (!password)
115 0 0 if (allowed_types & GIT_CREDENTIAL_USERPASS_PLAINTEXT)
118 0 0 if ((allowed_types & GIT_CREDENTIAL_DEFAULT) && *username == '\0' && *password == '\0')
0 0 if ((allowed_types & GIT_CREDENTIAL_DEFAULT) && *username == '\0' && *password == '\0')
0 0 if ((allowed_types & GIT_CREDENTIAL_DEFAULT) && *username == '\0' && *password == '\0')
126 0 0 if (*cred) {
143 0 0 if (server->cred)
147 0 0 if ((allowed_credtypes & GIT_CREDENTIAL_USERPASS_PLAINTEXT) &&
0 0 if ((allowed_credtypes & GIT_CREDENTIAL_USERPASS_PLAINTEXT) &&
148 0 0 !server->url_cred_presented &&
154 0 0 if (error == GIT_PASSTHROUGH)
158 0 0 if (error > 0 && callback) {
0 0 if (error > 0 && callback) {
162 0 0 if (error == GIT_PASSTHROUGH)
166 0 0 if (error > 0) {
171 0 0 if (!error)
184 0 0 if (response->server_auth_credtypes == 0) {
207 0 0 if (response->proxy_auth_credtypes == 0) {
248 0 0 if (allow_replay && git_http_response_is_redirect(response)) {
0 0 if (allow_replay && git_http_response_is_redirect(response)) {
249 0 0 if (!response->location) {
254 0 0 if (git_net_url_apply_redirect(&transport->server.url, response->location, allow_redirect(stream), stream->service->url) < 0) {
259 0 0 } else if (git_http_response_is_redirect(response)) {
265 0 0 if (allow_replay && response->resend_credentials) {
0 0 if (allow_replay && response->resend_credentials) {
267 0 0 } else if (allow_replay && response->status == GIT_HTTP_STATUS_UNAUTHORIZED) {
0 0 } else if (allow_replay && response->status == GIT_HTTP_STATUS_UNAUTHORIZED) {
268 0 0 if ((error = handle_remote_auth(stream, response)) < 0)
272 0 0 } else if (allow_replay && response->status == GIT_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED) {
0 0 } else if (allow_replay && response->status == GIT_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED) {
273 0 0 if ((error = handle_proxy_auth(stream, response)) < 0)
277 0 0 } else if (response->status == GIT_HTTP_STATUS_UNAUTHORIZED ||
0 0 } else if (response->status == GIT_HTTP_STATUS_UNAUTHORIZED ||
283 0 0 if (response->status != GIT_HTTP_STATUS_OK) {
289 0 0 if (!response->content_type) {
295 0 0 if (strcmp(response->content_type, stream->service->response_type) != 0) {
328 0 0 if (error || !config)
0 0 if (error || !config)
338 0 0 if (!proxy ||
0 0 if (!proxy ||
359 0 0 if ((error = git_net_url_joinpath(url,
360 0 0 &transport->server.url, stream->service->url)) < 0 ||
367 0 0 request->proxy = use_proxy ? &transport->proxy.url : NULL;
371 0 0 if (stream->service->method == GIT_HTTP_METHOD_POST) {
373 0 0 request->content_length = stream->service->chunked ? 0 : len;
405 0 0 if (stream->state == HTTP_STATE_NONE) {
414 0 0 while (stream->state == HTTP_STATE_SENDING_REQUEST &&
0 0 while (stream->state == HTTP_STATE_SENDING_REQUEST &&
420 0 0 if ((error = generate_request(&url, &request, stream, 0)) < 0 ||
0 0 if ((error = generate_request(&url, &request, stream, 0)) < 0 ||
422 0 0 transport->http_client, &request)) < 0 ||
424 0 0 &response, transport->http_client)) < 0 ||
428 0 0 if (complete)
434 0 0 if (stream->state == HTTP_STATE_SENDING_REQUEST) {
440 0 0 GIT_ASSERT(stream->state == HTTP_STATE_RECEIVING_RESPONSE);
444 0 0 if (error > 0) {
461 0 0 return (transport->server.auth_schemetypes == GIT_HTTP_AUTH_NTLM ||
0 0 return (transport->server.auth_schemetypes == GIT_HTTP_AUTH_NTLM ||
479 0 0 if (transport->server.auth_schemetypes == GIT_HTTP_AUTH_NTLM)
488 0 0 for (step = 0; step < steps && !complete; step++) {
0 0 for (step = 0; step < steps && !complete; step++) {
492 0 0 if ((error = generate_request(&url, &request, stream, len)) < 0 ||
0 0 if ((error = generate_request(&url, &request, stream, len)) < 0 ||
493 0 0 (error = git_http_client_send_request(client, &request)) < 0 ||
494 0 0 (error = git_http_client_send_body(client, probe, len)) < 0 ||
495 0 0 (error = git_http_client_read_response(&response, client)) < 0 ||
496 0 0 (error = git_http_client_skip_body(client)) < 0 ||
527 0 0 while (stream->state == HTTP_STATE_NONE &&
0 0 while (stream->state == HTTP_STATE_NONE &&
543 0 0 if (needs_probe(stream) && (error = send_probe(stream)) < 0)
0 0 if (needs_probe(stream) && (error = send_probe(stream)) < 0)
547 0 0 if ((error = generate_request(&url, &request, stream, len)) < 0 ||
0 0 if ((error = generate_request(&url, &request, stream, len)) < 0 ||
561 0 0 if ((error = git_http_client_read_response(&response, transport->http_client)) < 0 ||
0 0 if ((error = git_http_client_read_response(&response, transport->http_client)) < 0 ||
571 0 0 if (stream->state == HTTP_STATE_NONE) {
578 0 0 GIT_ASSERT(stream->state == HTTP_STATE_SENDING_REQUEST);
607 0 0 if (stream->state == HTTP_STATE_SENDING_REQUEST) {
608 0 0 if ((error = git_http_client_read_response(&response, client)) < 0 ||
0 0 if ((error = git_http_client_read_response(&response, client)) < 0 ||
612 0 0 GIT_ASSERT(complete);
618 0 0 if (error > 0) {
662 0 0 GIT_ASSERT_ARG(out);
663 0 0 GIT_ASSERT_ARG(t);
674 0 0 if (!git_net_url_valid(&transport->server.url) &&
0 0 if (!git_net_url_valid(&transport->server.url) &&
678 0 0 if ((service = select_service(action)) == NULL) {
684 0 0 GIT_ERROR_CHECK_ALLOC(stream);
686 0 0 if (!transport->http_client) {
694 0 0 if (git_http_client_new(&transport->http_client, &opts) < 0)
701 0 0 if (service->method == GIT_HTTP_METHOD_GET) {
746 0 0 GIT_ASSERT_ARG(out);
749 0 0 GIT_ERROR_CHECK_ALLOC(transport);