summaryrefslogtreecommitdiff
path: root/builtin/init-db.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-24 20:03:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-24 20:09:02 (GMT)
commit12d6ce1dba504dfc5279b8d24da3edb4865c2820 (patch)
treeb986a6e22bf290aa4f74d566169a6d54db6e4f3f /builtin/init-db.c
parent57c867efe4e005e40cfdee8a64550d7a95bbb9a0 (diff)
downloadgit-12d6ce1dba504dfc5279b8d24da3edb4865c2820.zip
git-12d6ce1dba504dfc5279b8d24da3edb4865c2820.tar.gz
git-12d6ce1dba504dfc5279b8d24da3edb4865c2820.tar.bz2
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 'builtin/init-db.c')
-rw-r--r--builtin/init-db.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 49df78d..bfe1d08 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -378,7 +378,7 @@ static void separate_git_dir(const char *git_dir)
die_errno(_("unable to move %s to %s"), src, git_dir);
}
- write_file(git_link, 1, "gitdir: %s\n", git_dir);
+ write_file(git_link, "gitdir: %s\n", git_dir);
}
int init_db(const char *template_dir, unsigned int flags)