make it more obvious that temporary files are temporary files
When some operations are interrupted (or "die()'d" or crashed) then the partial object/pack/index file may remain around. Make it more obvious in their name that those files are temporary stuff and can be cleaned up if no operation is in progress. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
46d409d0bf
commit
0e55181f29
@ -1979,7 +1979,7 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
|
||||
return error("sha1 file %s: %s\n", filename, strerror(errno));
|
||||
}
|
||||
|
||||
snprintf(tmpfile, sizeof(tmpfile), "%s/obj_XXXXXX", get_object_directory());
|
||||
snprintf(tmpfile, sizeof(tmpfile), "%s/tmp_obj_XXXXXX", get_object_directory());
|
||||
|
||||
fd = mkstemp(tmpfile);
|
||||
if (fd < 0) {
|
||||
@ -2105,7 +2105,7 @@ int write_sha1_from_fd(const unsigned char *sha1, int fd, char *buffer,
|
||||
int ret;
|
||||
SHA_CTX c;
|
||||
|
||||
snprintf(tmpfile, sizeof(tmpfile), "%s/obj_XXXXXX", get_object_directory());
|
||||
snprintf(tmpfile, sizeof(tmpfile), "%s/tmp_obj_XXXXXX", get_object_directory());
|
||||
|
||||
local = mkstemp(tmpfile);
|
||||
if (local < 0) {
|
||||
|
Reference in New Issue
Block a user