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

Function rename_tempfile

tempfile.c:336–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334}
335
336int rename_tempfile(struct tempfile **tempfile_p, const char *path)
337{
338 struct tempfile *tempfile = *tempfile_p;
339
340 if (!is_tempfile_active(tempfile))
341 BUG("rename_tempfile called for inactive object");
342
343 if (close_tempfile_gently(tempfile)) {
344 delete_tempfile(tempfile_p);
345 return -1;
346 }
347
348 if (rename(tempfile->filename.buf, path)) {
349 int save_errno = errno;
350 delete_tempfile(tempfile_p);
351 errno = save_errno;
352 return -1;
353 }
354
355 deactivate_tempfile(tempfile);
356 *tempfile_p = NULL;
357 return 0;
358}
359
360int delete_tempfile(struct tempfile **tempfile_p)
361{

Callers 10

write_commit_graph_fileFunction · 0.85
commit_lock_file_toFunction · 0.85
write_midx_internalFunction · 0.85
generated_pack_installFunction · 0.85
update_info_fileFunction · 0.85
write_shared_indexFunction · 0.85
write_file_in_placeFunction · 0.85
tmpfile_renameFunction · 0.85
interpret_trailersFunction · 0.85

Calls 4

is_tempfile_activeFunction · 0.85
close_tempfile_gentlyFunction · 0.85
delete_tempfileFunction · 0.85
deactivate_tempfileFunction · 0.85

Tested by

no test coverage detected