From cb5add58681db299d22cdccd898f9924e740034a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 7 Aug 2015 14:40:24 -0700 Subject: sha1_file.c: rename move_temp_to_file() to finalize_object_file() Since 5a688fe4 ("core.sharedrepository = 0mode" should set, not loosen, 2009-03-25), we kept reminding ourselves: NEEDSWORK: this should be renamed to finalize_temp_file() as "moving" is only a part of what it does, when no patch between master to pu changes the call sites of this function. without doing anything about it. Let's do so. The purpose of this function was not to move but to finalize. The detail of the primarily implementation of finalizing was to link the temporary file to its final name and then to unlink, which wasn't even "moving". The alternative implementation did "move" by calling rename(2), which is a fun tangent. Signed-off-by: Junio C Hamano --- fast-import.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fast-import.c') diff --git a/fast-import.c b/fast-import.c index fb4738d373..9479ce6d0f 100644 --- a/fast-import.c +++ b/fast-import.c @@ -919,12 +919,12 @@ static char *keep_pack(const char *curr_index_name) snprintf(name, sizeof(name), "%s/pack/pack-%s.pack", get_object_directory(), sha1_to_hex(pack_data->sha1)); - if (move_temp_to_file(pack_data->pack_name, name)) + if (finalize_object_file(pack_data->pack_name, name)) die("cannot store pack file"); snprintf(name, sizeof(name), "%s/pack/pack-%s.idx", get_object_directory(), sha1_to_hex(pack_data->sha1)); - if (move_temp_to_file(curr_index_name, name)) + if (finalize_object_file(curr_index_name, name)) die("cannot store index file"); free((void *)curr_index_name); return name; -- cgit v1.2.3