mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-25 12:24:47 +02:00
This allows us to tell whether they appear in the user's config file, which we will need later in this branch.
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package custom_commands
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
"github.com/jesseduffield/lazygit/pkg/integration/tests/shared"
|
|
)
|
|
|
|
var CheckForConflicts = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Run a command and check for conflicts after",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
SetupRepo: func(shell *Shell) {
|
|
shared.MergeConflictsSetup(shell)
|
|
},
|
|
SetupConfig: func(cfg *config.AppConfig) {
|
|
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
|
|
{
|
|
Key: "m",
|
|
Context: "localBranches",
|
|
Command: "git merge {{ .SelectedLocalBranch.Name | quote }}",
|
|
After: &config.CustomCommandAfterHook{
|
|
CheckForConflicts: true,
|
|
},
|
|
},
|
|
}
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Branches().
|
|
Focus().
|
|
TopLines(
|
|
Contains("first-change-branch"),
|
|
Contains("second-change-branch"),
|
|
).
|
|
NavigateToLine(Contains("second-change-branch")).
|
|
Press("m")
|
|
|
|
t.Common().AcknowledgeConflicts()
|
|
},
|
|
})
|