@@ -1318,7 +1318,7 @@ static int http_get_file(const char *url, const char *filename,
13181318 ret = http_request_reauth (url , result , HTTP_REQUEST_FILE , options );
13191319 fclose (result );
13201320
1321- if (ret == HTTP_OK && move_temp_to_file (tmpfile .buf , filename ))
1321+ if (ret == HTTP_OK && finalize_object_file (tmpfile .buf , filename ))
13221322 ret = HTTP_ERROR ;
13231323cleanup :
13241324 strbuf_release (& tmpfile );
@@ -1405,7 +1405,7 @@ static int fetch_and_setup_pack_index(struct packed_git **packs_head,
14051405 ret = verify_pack_index (new_pack );
14061406 if (!ret ) {
14071407 close_pack_index (new_pack );
1408- ret = move_temp_to_file (tmp_idx , sha1_pack_index_name (sha1 ));
1408+ ret = finalize_object_file (tmp_idx , sha1_pack_index_name (sha1 ));
14091409 }
14101410 free (tmp_idx );
14111411 if (ret )
@@ -1517,8 +1517,8 @@ int finish_http_pack_request(struct http_pack_request *preq)
15171517
15181518 unlink (sha1_pack_index_name (p -> sha1 ));
15191519
1520- if (move_temp_to_file (preq -> tmpfile , sha1_pack_name (p -> sha1 ))
1521- || move_temp_to_file (tmp_idx , sha1_pack_index_name (p -> sha1 ))) {
1520+ if (finalize_object_file (preq -> tmpfile , sha1_pack_name (p -> sha1 ))
1521+ || finalize_object_file (tmp_idx , sha1_pack_index_name (p -> sha1 ))) {
15221522 free (tmp_idx );
15231523 return -1 ;
15241524 }
@@ -1782,7 +1782,7 @@ int finish_http_object_request(struct http_object_request *freq)
17821782 return -1 ;
17831783 }
17841784 freq -> rename =
1785- move_temp_to_file (freq -> tmpfile , sha1_file_name (freq -> sha1 ));
1785+ finalize_object_file (freq -> tmpfile , sha1_file_name (freq -> sha1 ));
17861786
17871787 return freq -> rename ;
17881788}
0 commit comments