mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
It is useful to see if the conflicted commit was a "pick" or an "edit". What's more, we're about to add support for showing cherry-picks and reverts, and seeing that a conflicted commit was a revert is important because its diff is backwards compared to the diff of the conflicting files in the Files panel.
75 lines
1.5 KiB
Go
75 lines
1.5 KiB
Go
package interactive_rebase
|
|
|
|
import (
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
func handleConflictsFromSwap(t *TestDriver, expectedCommand string) {
|
|
t.Common().AcknowledgeConflicts()
|
|
|
|
t.Views().Commits().
|
|
Lines(
|
|
Contains("pick").Contains("commit two"),
|
|
Contains(expectedCommand).Contains("<-- CONFLICT --- commit three"),
|
|
Contains("commit one"),
|
|
)
|
|
|
|
t.Views().Files().
|
|
IsFocused().
|
|
Lines(
|
|
Contains("UU myfile"),
|
|
).
|
|
PressEnter()
|
|
|
|
t.Views().MergeConflicts().
|
|
IsFocused().
|
|
TopLines(
|
|
Contains("<<<<<<< HEAD"),
|
|
Contains("one"),
|
|
Contains("======="),
|
|
Contains("three"),
|
|
Contains(">>>>>>>"),
|
|
).
|
|
SelectNextItem().
|
|
PressPrimaryAction() // pick "three"
|
|
|
|
t.Common().ContinueOnConflictsResolved("rebase")
|
|
|
|
t.Common().AcknowledgeConflicts()
|
|
|
|
t.Views().Files().
|
|
IsFocused().
|
|
Lines(
|
|
Contains("UU myfile"),
|
|
).
|
|
PressEnter()
|
|
|
|
t.Views().MergeConflicts().
|
|
IsFocused().
|
|
TopLines(
|
|
Contains("<<<<<<< HEAD"),
|
|
Contains("three"),
|
|
Contains("======="),
|
|
Contains("two"),
|
|
Contains(">>>>>>>"),
|
|
).
|
|
SelectNextItem().
|
|
PressPrimaryAction() // pick "two"
|
|
|
|
t.Common().ContinueOnConflictsResolved("rebase")
|
|
|
|
t.Views().Commits().
|
|
Focus().
|
|
Lines(
|
|
Contains("commit two").IsSelected(),
|
|
Contains("commit three"),
|
|
Contains("commit one"),
|
|
).
|
|
Tap(func() {
|
|
t.Views().Main().Content(Contains("-three").Contains("+two"))
|
|
}).
|
|
SelectNextItem().
|
|
Tap(func() {
|
|
t.Views().Main().Content(Contains("-one").Contains("+three"))
|
|
})
|
|
}
|