aboutsummaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-19 14:48:55 -0700
committerJunio C Hamano <gitster@pobox.com>2015-08-19 14:48:55 -0700
commit51a22ce1477b991793c20d3143d72f0ae6e38c76 (patch)
treed771608f4ebc48a899196524534b5912632cd843 /http.c
parent4bfab58ce2d47cef9236571cb1451bf3b62241c1 (diff)
parentcb5add58681db299d22cdccd898f9924e740034a (diff)
downloadgit-51a22ce1477b991793c20d3143d72f0ae6e38c76.tar.gz
git-51a22ce1477b991793c20d3143d72f0ae6e38c76.tar.xz
Merge branch 'jc/finalize-temp-file'
Long overdue micro clean-up. * jc/finalize-temp-file: sha1_file.c: rename move_temp_to_file() to finalize_object_file()
Diffstat (limited to 'http.c')
-rw-r--r--http.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/http.c b/http.c
index e9c6fdd83..8cd59f7f3 100644
--- a/http.c
+++ b/http.c
@@ -1318,7 +1318,7 @@ static int http_get_file(const char *url, const char *filename,
ret = http_request_reauth(url, result, HTTP_REQUEST_FILE, options);
fclose(result);
- if (ret == HTTP_OK && move_temp_to_file(tmpfile.buf, filename))
+ if (ret == HTTP_OK && finalize_object_file(tmpfile.buf, filename))
ret = HTTP_ERROR;
cleanup:
strbuf_release(&tmpfile);
@@ -1405,7 +1405,7 @@ static int fetch_and_setup_pack_index(struct packed_git **packs_head,
ret = verify_pack_index(new_pack);
if (!ret) {
close_pack_index(new_pack);
- ret = move_temp_to_file(tmp_idx, sha1_pack_index_name(sha1));
+ ret = finalize_object_file(tmp_idx, sha1_pack_index_name(sha1));
}
free(tmp_idx);
if (ret)
@@ -1517,8 +1517,8 @@ int finish_http_pack_request(struct http_pack_request *preq)
unlink(sha1_pack_index_name(p->sha1));
- if (move_temp_to_file(preq->tmpfile, sha1_pack_name(p->sha1))
- || move_temp_to_file(tmp_idx, sha1_pack_index_name(p->sha1))) {
+ if (finalize_object_file(preq->tmpfile, sha1_pack_name(p->sha1))
+ || finalize_object_file(tmp_idx, sha1_pack_index_name(p->sha1))) {
free(tmp_idx);
return -1;
}
@@ -1782,7 +1782,7 @@ int finish_http_object_request(struct http_object_request *freq)
return -1;
}
freq->rename =
- move_temp_to_file(freq->tmpfile, sha1_file_name(freq->sha1));
+ finalize_object_file(freq->tmpfile, sha1_file_name(freq->sha1));
return freq->rename;
}