diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-08-24 13:03:07 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-24 13:09:02 -0700 |
commit | 12d6ce1dba504dfc5279b8d24da3edb4865c2820 (patch) | |
tree | b986a6e22bf290aa4f74d566169a6d54db6e4f3f /setup.c | |
parent | 57c867efe4e005e40cfdee8a64550d7a95bbb9a0 (diff) | |
download | git-12d6ce1dba504dfc5279b8d24da3edb4865c2820.tar.gz |
write_file(): drop "fatal" parameter
All callers except three passed 1 for the "fatal" parameter to ask
this function to die upon error, but to a casual reader of the code,
it was not all obvious what that 1 meant. Instead, split the
function into two based on a common write_file_v() that takes the
flag, introduce write_file_gently() as a new way to attempt creating
a file without dying on error, and make three callers to call it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -404,7 +404,7 @@ static void update_linked_gitdir(const char *gitfile, const char *gitdir) strbuf_addf(&path, "%s/gitfile", gitdir); if (stat(path.buf, &st) || st.st_mtime + 24 * 3600 < time(NULL)) - write_file(path.buf, 0, "%s\n", gitfile); + write_file_gently(path.buf, "%s\n", gitfile); strbuf_release(&path); } |