summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/controllers/helpers/commits_helper.go9
-rw-r--r--pkg/integration/tests/commit/preserve_commit_message.go8
2 files changed, 2 insertions, 15 deletions
diff --git a/pkg/gui/controllers/helpers/commits_helper.go b/pkg/gui/controllers/helpers/commits_helper.go
index 5d388c319..8691518cd 100644
--- a/pkg/gui/controllers/helpers/commits_helper.go
+++ b/pkg/gui/controllers/helpers/commits_helper.go
@@ -41,13 +41,8 @@ func NewCommitsHelper(
}
func (self *CommitsHelper) SplitCommitMessageAndDescription(message string) (string, string) {
- for _, separator := range []string{"\n\n", "\n\r\n\r", "\n", "\n\r"} {
- msg, description, found := strings.Cut(message, separator)
- if found {
- return msg, description
- }
- }
- return message, ""
+ msg, description, _ := strings.Cut(message, "\n")
+ return msg, strings.TrimSpace(description)
}
func (self *CommitsHelper) SetMessageAndDescriptionInView(message string) {
diff --git a/pkg/integration/tests/commit/preserve_commit_message.go b/pkg/integration/tests/commit/preserve_commit_message.go
index 5a580e854..e9297ab76 100644
--- a/pkg/integration/tests/commit/preserve_commit_message.go
+++ b/pkg/integration/tests/commit/preserve_commit_message.go
@@ -32,17 +32,9 @@ var PreserveCommitMessage = NewIntegrationTest(NewIntegrationTestArgs{
IsFocused().
Press(keys.Files.CommitChanges)
- /* EXPECTED:
t.ExpectPopup().CommitMessagePanel().
Content(Equals("my commit message")).
SwitchToDescription().
Content(Equals("first paragraph\n\nsecond paragraph"))
-
- ACTUAL:
- */
- t.ExpectPopup().CommitMessagePanel().
- Content(Equals("my commit message\nfirst paragraph")).
- SwitchToDescription().
- Content(Equals("second paragraph"))
},
})