mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-13 16:23:32 -04:00
Add a test for pasting a multi-line commit message into the summary
If you paste a commit message into the summary with the terminal's paste command, the description starts with an empty line. The first newline of the pasted text moves to the description, and the second one (the blank line between subject and body) is typed into the description. Git strips the empty line when committing, but it looks broken in the panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ad52544df8
commit
9d2058fbc4
@@ -0,0 +1,33 @@
|
||||
package commit
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var PasteMultiLineCommitMessage = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Paste a multi-line commit message into the summary with the terminal's paste command",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.CreateFileAndAdd("file", "file content")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Files().
|
||||
Focus().
|
||||
Press(keys.Files.CommitChanges)
|
||||
|
||||
t.ExpectPopup().CommitMessagePanel().
|
||||
Paste("subject\n\nbody line 1\nbody line 2").
|
||||
Content(Equals("subject"))
|
||||
|
||||
t.Views().CommitDescription().
|
||||
IsFocused().
|
||||
Content(Equals(
|
||||
/* EXPECTED:
|
||||
"body line 1\nbody line 2"))
|
||||
ACTUAL: */
|
||||
"\nbody line 1\nbody line 2"))
|
||||
},
|
||||
})
|
||||
@@ -187,6 +187,7 @@ var tests = []*components.IntegrationTest{
|
||||
commit.PasteCommitMessageOverExisting,
|
||||
commit.PasteCommitMessageWithHardLineBreaks,
|
||||
commit.PasteIntoCommitDescription,
|
||||
commit.PasteMultiLineCommitMessage,
|
||||
commit.PreserveCommitMessage,
|
||||
commit.PreserveCommitMessageWhitespace,
|
||||
commit.ResetAuthor,
|
||||
|
||||
Reference in New Issue
Block a user