sublime_merge icon indicating copy to clipboard operation
sublime_merge copied to clipboard

Amend fails when commit message is nothing but newlines

Open allejo opened this issue 6 months ago • 1 comments

Version info

  • OS: macOS 14.1.2
  • Build: 2091

Description

In my Git configuration, I have commit.template set to a file with the following contents.

# Commit


# Extended desc


# 50 char ---------------------------------------|
# 72 char =============================================================|

When I go and try to amend a commit, it fails because I have an empty commit message. The new lines are being treated as "non-empty" according to Merge but Git treats them as empty

image

Steps to reproduce

Steps to reproduce the behavior:

  1. Amend a commit with newlines only in the commit message

Expected behavior

It should trim the newlines and treat it as an empty commit message and use the --no-edit flag

allejo avatar Dec 21 '23 02:12 allejo