MCPcopy Index your code
hub / github.com/git/git / finish_http_object_request

Function finish_http_object_request

http.c:2970–3004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2968}
2969
2970int finish_http_object_request(struct http_object_request *freq)
2971{
2972 struct odb_source_files *files = odb_source_files_downcast(the_repository->objects->sources);
2973 struct stat st;
2974 struct strbuf filename = STRBUF_INIT;
2975
2976 close(freq->localfile);
2977 freq->localfile = -1;
2978
2979 process_http_object_request(freq);
2980
2981 if (freq->http_code == 416) {
2982 warning("requested range invalid; we may already have all the data.");
2983 } else if (freq->curl_result != CURLE_OK) {
2984 if (stat(freq->tmpfile.buf, &st) == 0)
2985 if (st.st_size == 0)
2986 unlink_or_warn(freq->tmpfile.buf);
2987 return -1;
2988 }
2989
2990 git_hash_final_oid(&freq->real_oid, &freq->c);
2991 if (freq->zret != Z_STREAM_END) {
2992 unlink_or_warn(freq->tmpfile.buf);
2993 return -1;
2994 }
2995 if (!oideq(&freq->oid, &freq->real_oid)) {
2996 unlink_or_warn(freq->tmpfile.buf);
2997 return -1;
2998 }
2999 odb_loose_path(files->loose, &filename, &freq->oid);
3000 freq->rename = finalize_object_file(the_repository, freq->tmpfile.buf, filename.buf);
3001 strbuf_release(&filename);
3002
3003 return freq->rename;
3004}
3005
3006void abort_http_object_request(struct http_object_request **freq_p)
3007{

Callers 2

finish_object_requestFunction · 0.85
finish_requestFunction · 0.85

Calls 10

warningFunction · 0.85
unlink_or_warnFunction · 0.85
git_hash_final_oidFunction · 0.85
oideqFunction · 0.85
odb_loose_pathFunction · 0.85
finalize_object_fileFunction · 0.85
strbuf_releaseFunction · 0.85
statClass · 0.70

Tested by

no test coverage detected