Skip to content

Commit 2454ac7

Browse files
sbeyergitster
authored andcommitted
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 f5bbc32 "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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f8aa1b6 commit 2454ac7

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

builtin-commit.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,6 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
625625
if (!commitable && !in_merge && !allow_empty &&
626626
!(amend && is_a_merge(head_sha1))) {
627627
run_status(stdout, index_file, prefix, 0);
628-
unlink(commit_editmsg);
629628
return 0;
630629
}
631630

0 commit comments

Comments
 (0)