mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
Add test for amending a merge commit
This commit is contained in:
@ -64,7 +64,7 @@ func (s *Shell) Checkout(name string) *Shell {
|
||||
}
|
||||
|
||||
func (s *Shell) Merge(name string) *Shell {
|
||||
return s.RunCommand("git merge --commit " + name)
|
||||
return s.RunCommand("git merge --commit --no-ff " + name)
|
||||
}
|
||||
|
||||
func (s *Shell) GitAdd(path string) *Shell {
|
||||
|
37
pkg/integration/tests/interactive_rebase/amend_merge.go
Normal file
37
pkg/integration/tests/interactive_rebase/amend_merge.go
Normal file
@ -0,0 +1,37 @@
|
||||
package interactive_rebase
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var AmendMerge = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Amends a staged file to a merge commit.",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.
|
||||
NewBranch("development-branch").
|
||||
CreateFileAndAdd("initial-file", "content").
|
||||
Commit("initial commit").
|
||||
NewBranch("feature-branch"). // it's also checked out automatically
|
||||
CreateFileAndAdd("new-feature-file", "new content").
|
||||
Commit("new feature commit").
|
||||
CheckoutBranch("development-branch").
|
||||
Merge("feature-branch").
|
||||
CreateFileAndAdd("post-merge-file", "content")
|
||||
},
|
||||
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
||||
assert.CommitCount(3)
|
||||
|
||||
input.SwitchToCommitsWindow()
|
||||
assert.CurrentViewName("commits")
|
||||
|
||||
input.PressKeys(keys.Commits.AmendToCommit)
|
||||
input.PressKeys(keys.Universal.Return)
|
||||
|
||||
assert.MatchHeadCommitMessage(Contains("Merge"))
|
||||
assert.CommitCount(3)
|
||||
},
|
||||
})
|
@ -29,6 +29,7 @@ var tests = []*components.IntegrationTest{
|
||||
branch.Rebase,
|
||||
branch.RebaseAndDrop,
|
||||
interactive_rebase.One,
|
||||
interactive_rebase.AmendMerge,
|
||||
custom_commands.Basic,
|
||||
custom_commands.MultiplePrompts,
|
||||
custom_commands.MenuFromCommand,
|
||||
|
Reference in New Issue
Block a user