1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
package interactive_rebase
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var SquashFixupsInCurrentBranch = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Squashes all fixups in the current branch.",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.
CreateFileAndAdd("file1", "file1").
Commit("master commit").
NewBranch("branch").
// Test the pathological case that the first commit of a branch is a
// fixup for the last master commit below it. We _don't_ want this to
// be squashed.
UpdateFileAndAdd("file1", "changed file1").
Commit("fixup! master commit").
CreateNCommits(2).
CreateFileAndAdd("fixup-file", "fixup content").
Commit("fixup! commit 01")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().
Focus().
Lines(
Contains("fixup! commit 01"),
Contains("commit 02"),
Contains("commit 01"),
Contains("fixup! master commit"),
Contains("master commit"),
).
Press(keys.Commits.SquashAboveCommits).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Apply fixup commits")).
Select(Contains("In current branch")).
Confirm()
}).
Lines(
Contains("commit 02"),
Contains("commit 01"),
Contains("fixup! master commit"),
Contains("master commit"),
).
NavigateToLine(Contains("commit 01"))
t.Views().Main().
Content(Contains("fixup content"))
},
})
|