From: Stephan Beyer Date: Fri, 16 Jan 2009 19:40:05 +0000 (+0100) Subject: builtin-commit.c: do not remove COMMIT_EDITMSG X-Git-Tag: v1.6.1.1~10^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2454ac7b9fbc12db5cca8cd388422360528d7d6f;p=git.git builtin-commit.c: do not remove COMMIT_EDITMSG git-commit tries to remove the file ./COMMIT_EDITMSG instead of $GIT_DIR/COMMIT_EDITMSG after commit preparation (e.g. running hooks, launching editor). This behavior exists since f5bbc3225c4b07 "Port git commit to C". Some test cases (e.g. t/t7502-commit.sh) rely on the existence of $GIT_DIR/COMMIT_EDITMSG after committing and, I guess, many people are used to it. So it is best not to remove it. This patch just removes the removal of COMMIT_EDITMSG. Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano --- diff --git a/builtin-commit.c b/builtin-commit.c index 1e0839991..6cbdd55f1 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -625,7 +625,6 @@ static int prepare_to_commit(const char *index_file, const char *prefix) if (!commitable && !in_merge && !allow_empty && !(amend && is_a_merge(head_sha1))) { run_status(stdout, index_file, prefix, 0); - unlink(commit_editmsg); return 0; }