Branch Coverage

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


line true false branch
108 0 0 if (allowed_types & GIT_CREDENTIAL_USERPASS_PLAINTEXT)
111 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')
119 0 0 if (*cred) {
136 0 0 if (server->cred)
140 0 0 if ((allowed_credtypes & GIT_CREDENTIAL_USERPASS_PLAINTEXT) &&
0 0 if ((allowed_credtypes & GIT_CREDENTIAL_USERPASS_PLAINTEXT) &&
141 0 0 !server->url_cred_presented &&
142 0 0 server->url.username &&
148 0 0 if (error == GIT_PASSTHROUGH)
152 0 0 if (error > 0 && callback) {
0 0 if (error > 0 && callback) {
156 0 0 if (error == GIT_PASSTHROUGH)
160 0 0 if (error > 0) {
165 0 0 if (!error)
177 0 0 if (response->server_auth_credtypes == 0) {
199 0 0 if (response->proxy_auth_credtypes == 0) {
227 0 0 if (allow_replay && git_http_response_is_redirect(response)) {
0 0 if (allow_replay && git_http_response_is_redirect(response)) {
228 0 0 if (!response->location) {
233 0 0 if (git_net_url_apply_redirect(&transport->server.url, response->location, stream->service->url) < 0) {
238 0 0 } else if (git_http_response_is_redirect(response)) {
244 0 0 if (allow_replay && response->resend_credentials) {
0 0 if (allow_replay && response->resend_credentials) {
246 0 0 } else if (allow_replay && response->status == GIT_HTTP_STATUS_UNAUTHORIZED) {
0 0 } else if (allow_replay && response->status == GIT_HTTP_STATUS_UNAUTHORIZED) {
247 0 0 if ((error = handle_remote_auth(stream, response)) < 0)
251 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) {
252 0 0 if ((error = handle_proxy_auth(stream, response)) < 0)
256 0 0 } else if (response->status == GIT_HTTP_STATUS_UNAUTHORIZED ||
0 0 } else if (response->status == GIT_HTTP_STATUS_UNAUTHORIZED ||
262 0 0 if (response->status != GIT_HTTP_STATUS_OK) {
268 0 0 if (!response->content_type) {
274 0 0 if (strcmp(response->content_type, stream->service->response_type) != 0) {
308 0 0 if (error || !config)
0 0 if (error || !config)
318 0 0 if (!proxy ||
0 0 if (!proxy ||
339 0 0 if ((error = git_net_url_joinpath(url,
340 0 0 &transport->server.url, stream->service->url)) < 0 ||
347 0 0 request->proxy = use_proxy ? &transport->proxy.url : NULL;
351 0 0 if (stream->service->method == GIT_HTTP_METHOD_POST) {
353 0 0 request->content_length = stream->service->chunked ? 0 : len;
385 0 0 if (stream->state == HTTP_STATE_NONE) {
394 0 0 while (stream->state == HTTP_STATE_SENDING_REQUEST &&
0 0 while (stream->state == HTTP_STATE_SENDING_REQUEST &&
400 0 0 if ((error = generate_request(&url, &request, stream, 0)) < 0 ||
0 0 if ((error = generate_request(&url, &request, stream, 0)) < 0 ||
402 0 0 transport->http_client, &request)) < 0 ||
404 0 0 &response, transport->http_client)) < 0 ||
408 0 0 if (complete)
414 0 0 if (stream->state == HTTP_STATE_SENDING_REQUEST) {
420 0 0 assert (stream->state == HTTP_STATE_RECEIVING_RESPONSE);
424 0 0 if (error > 0) {
441 0 0 return (transport->server.auth_schemetypes == GIT_HTTP_AUTH_NTLM ||
0 0 return (transport->server.auth_schemetypes == GIT_HTTP_AUTH_NTLM ||
459 0 0 if (transport->server.auth_schemetypes == GIT_HTTP_AUTH_NTLM)
468 0 0 for (step = 0; step < steps && !complete; step++) {
0 0 for (step = 0; step < steps && !complete; step++) {
472 0 0 if ((error = generate_request(&url, &request, stream, len)) < 0 ||
0 0 if ((error = generate_request(&url, &request, stream, len)) < 0 ||
473 0 0 (error = git_http_client_send_request(client, &request)) < 0 ||
474 0 0 (error = git_http_client_send_body(client, probe, len)) < 0 ||
475 0 0 (error = git_http_client_read_response(&response, client)) < 0 ||
476 0 0 (error = git_http_client_skip_body(client)) < 0 ||
507 0 0 while (stream->state == HTTP_STATE_NONE &&
0 0 while (stream->state == HTTP_STATE_NONE &&
523 0 0 if (needs_probe(stream) && (error = send_probe(stream)) < 0)
0 0 if (needs_probe(stream) && (error = send_probe(stream)) < 0)
527 0 0 if ((error = generate_request(&url, &request, stream, len)) < 0 ||
0 0 if ((error = generate_request(&url, &request, stream, len)) < 0 ||
541 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 ||
551 0 0 if (stream->state == HTTP_STATE_NONE) {
558 0 0 assert(stream->state == HTTP_STATE_SENDING_REQUEST);
587 0 0 if (stream->state == HTTP_STATE_SENDING_REQUEST) {
588 0 0 if ((error = git_http_client_read_response(&response, client)) < 0 ||
0 0 if ((error = git_http_client_read_response(&response, client)) < 0 ||
592 0 0 assert(complete);
598 0 0 if (error > 0) {
641 0 0 assert(out && t);
0 0 assert(out && t);
652 0 0 if (!git_net_url_valid(&transport->server.url) &&
0 0 if (!git_net_url_valid(&transport->server.url) &&
656 0 0 if ((service = select_service(action)) == NULL) {
662 0 0 GIT_ERROR_CHECK_ALLOC(stream);
664 0 0 if (!transport->http_client) {
672 0 0 if (git_http_client_new(&transport->http_client, &opts) < 0)
679 0 0 if (service->method == GIT_HTTP_METHOD_GET) {
724 0 0 assert(out);
727 0 0 GIT_ERROR_CHECK_ALLOC(transport);