MCPcopy Create free account
hub / github.com/git/git / process_log_file

Function process_log_file

builtin/gc.c:78–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78static void process_log_file(void)
79{
80 struct stat st;
81 if (fstat(get_lock_file_fd(&log_lock), &st)) {
82 /*
83 * Perhaps there was an i/o error or another
84 * unlikely situation. Try to make a note of
85 * this in gc.log along with any existing
86 * messages.
87 */
88 int saved_errno = errno;
89 fprintf(stderr, _("Failed to fstat %s: %s"),
90 get_lock_file_path(&log_lock),
91 strerror(saved_errno));
92 fflush(stderr);
93 commit_lock_file(&log_lock);
94 errno = saved_errno;
95 } else if (st.st_size) {
96 /* There was some error recorded in the lock file */
97 commit_lock_file(&log_lock);
98 } else {
99 char *path = repo_git_path(the_repository, "gc.log");
100 /* No error, clean up any old gc.log */
101 unlink(path);
102 rollback_lock_file(&log_lock);
103 free(path);
104 }
105}
106
107static void process_log_file_at_exit(void)
108{

Callers 1

process_log_file_at_exitFunction · 0.85

Calls 5

get_lock_file_fdFunction · 0.85
get_lock_file_pathFunction · 0.85
commit_lock_fileFunction · 0.85
repo_git_pathFunction · 0.85
rollback_lock_fileFunction · 0.85

Tested by

no test coverage detected