Merge branch 'jc/strbuf-getline'
[gitweb.git] / builtin / commit.c
index d9db59e1d275fbe0fac5c3ca461d8fdec3adcf2e..b3bd2d41813f80d848afc199c2fae92cae6b6c11 100644 (file)
@@ -761,7 +761,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
                hook_arg2 = "";
        }
 
-       s->fp = fopen(git_path(commit_editmsg), "w");
+       s->fp = fopen_for_writing(git_path(commit_editmsg));
        if (s->fp == NULL)
                die_errno(_("could not open '%s'"), git_path(commit_editmsg));