Skip to content

Commit

Permalink
builtin-commit: remove .git/SQUASH_MSG upon successful commit
Browse files Browse the repository at this point in the history
After doing a merge --squash, and commit afterwards, the commit message
template SQUASH_MSG in the git directory is not removed, which means that
the content of SQUASH_MSG is used as default commit message for all
subsequent commits.  So have git commit remove the file SQUASH_MSG from
the git directory upon a successful commit.

The problem was discovered by Frédéric Brière, reported through
 http://bugs.debian.org/464656

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Gerrit Pape authored and Junio C Hamano committed Feb 11, 2008
1 parent 8464010 commit 5a95b85
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)

unlink(git_path("MERGE_HEAD"));
unlink(git_path("MERGE_MSG"));
unlink(git_path("SQUASH_MSG"));

if (commit_index_files())
die ("Repository has been updated, but unable to write\n"
Expand Down

0 comments on commit 5a95b85

Please sign in to comment.