diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2016-01-06 14:09:43 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-01-07 13:52:55 -0800 |
commit | 79d7582e32ca84eacf032298c8ae3d26816f48d0 (patch) | |
tree | 370b19ccf775725f0a2a28e21e7443b330dffe1a /builtin/commit.c | |
parent | 833e48259e23aea76f3765d28d1b2200332301f7 (diff) | |
download | git-79d7582e32ca84eacf032298c8ae3d26816f48d0.tar.gz |
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>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r-- | builtin/commit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index f2a8b78c7a..ce11a17f8a 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -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)); |