commit: allow editing the commit message even in shared repos
It was pointed out by Yaroslav Halchenko that the file containing the commit message is writable only by the owner, which means that we have to rewrite it from scratch in a shared repository. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
833e48259e
commit
79d7582e32
@ -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));
|
||||
|
||||
|
Reference in New Issue
Block a user