commit: allow editing the commit message even in shared repos
[gitweb.git] / builtin / commit.c
index f2a8b78c7a7c5f52c46e03e644cf50413b643d3e..ce11a17f8ac51f4f9045db419ea2c253524cf078 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));