mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
In pretty much 100% of the cases, you want to use -m1, so spare users the complexity of a confusing prompt. See https://public-inbox.org/git/e60a8b1a-98c8-4ac7-b966-ff9635bb781d@haller-berlin.de/ for some discussion.
38 lines
1.2 KiB
Go
38 lines
1.2 KiB
Go
package commit
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
"github.com/jesseduffield/lazygit/pkg/integration/tests/shared"
|
|
)
|
|
|
|
var RevertMerge = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Reverts a merge commit and chooses to revert to the parent commit",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
SetupConfig: func(config *config.AppConfig) {},
|
|
SetupRepo: func(shell *Shell) {
|
|
shared.CreateMergeCommit(shell)
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Commits().Focus().
|
|
TopLines(
|
|
Contains("Merge branch 'second-change-branch' into first-change-branch").IsSelected(),
|
|
).
|
|
Press(keys.Commits.RevertCommit)
|
|
|
|
t.ExpectPopup().Confirmation().
|
|
Title(Equals("Revert commit")).
|
|
Content(MatchesRegexp(`Are you sure you want to revert \w+?`)).
|
|
Confirm()
|
|
|
|
t.Views().Commits().IsFocused().
|
|
TopLines(
|
|
Contains("Revert \"Merge branch 'second-change-branch' into first-change-branch\""),
|
|
Contains("Merge branch 'second-change-branch' into first-change-branch").IsSelected(),
|
|
).
|
|
SelectPreviousItem()
|
|
|
|
t.Views().Main().Content(Contains("-Second Change").Contains("+First Change"))
|
|
},
|
|
})
|