1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-13 01:30:53 +02:00

Add section headers for rebase todos, cherry-picks, reverts, and actual commits

This commit is contained in:
Stefan Haller
2025-04-04 18:26:33 +02:00
parent 98c19feccf
commit 6cbc1e0ace
46 changed files with 231 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package context package context
import ( import (
"fmt"
"log" "log"
"strings" "strings"
"time" "time"
@ -66,6 +67,51 @@ func NewLocalCommitsContext(c *ContextCommon) *LocalCommitsContext {
) )
} }
getNonModelItems := func() []*NonModelItem {
result := []*NonModelItem{}
if c.Model().WorkingTreeStateAtLastCommitRefresh.CanShowTodos() {
if c.Model().WorkingTreeStateAtLastCommitRefresh.Rebasing {
result = append(result, &NonModelItem{
Index: 0,
Content: fmt.Sprintf("--- %s ---", c.Tr.PendingRebaseTodosSectionHeader),
})
}
if c.Model().WorkingTreeStateAtLastCommitRefresh.CherryPicking ||
c.Model().WorkingTreeStateAtLastCommitRefresh.Reverting {
_, firstCherryPickOrRevertTodo, found := lo.FindIndexOf(
c.Model().Commits, func(c *models.Commit) bool {
return c.Status == models.StatusCherryPickingOrReverting ||
c.Status == models.StatusConflicted
})
if !found {
firstCherryPickOrRevertTodo = 0
}
label := lo.Ternary(c.Model().WorkingTreeStateAtLastCommitRefresh.CherryPicking,
c.Tr.PendingCherryPicksSectionHeader,
c.Tr.PendingRevertsSectionHeader)
result = append(result, &NonModelItem{
Index: firstCherryPickOrRevertTodo,
Content: fmt.Sprintf("--- %s ---", label),
})
}
_, firstRealCommit, found := lo.FindIndexOf(
c.Model().Commits, func(c *models.Commit) bool {
return !c.IsTODO()
})
if !found {
firstRealCommit = 0
}
result = append(result, &NonModelItem{
Index: firstRealCommit,
Content: fmt.Sprintf("--- %s ---", c.Tr.CommitsSectionHeader),
})
}
return result
}
ctx := &LocalCommitsContext{ ctx := &LocalCommitsContext{
LocalCommitsViewModel: viewModel, LocalCommitsViewModel: viewModel,
SearchTrait: NewSearchTrait(c), SearchTrait: NewSearchTrait(c),
@ -82,6 +128,7 @@ func NewLocalCommitsContext(c *ContextCommon) *LocalCommitsContext {
ListRenderer: ListRenderer{ ListRenderer: ListRenderer{
list: viewModel, list: viewModel,
getDisplayStrings: getDisplayStrings, getDisplayStrings: getDisplayStrings,
getNonModelItems: getNonModelItems,
}, },
c: c, c: c,
refreshViewportOnChange: true, refreshViewportOnChange: true,

View File

@ -350,6 +350,10 @@ type TranslationSet struct {
NoRoom string NoRoom string
YouAreHere string YouAreHere string
ConflictLabel string ConflictLabel string
PendingRebaseTodosSectionHeader string
PendingCherryPicksSectionHeader string
PendingRevertsSectionHeader string
CommitsSectionHeader string
YouDied string YouDied string
RewordNotSupported string RewordNotSupported string
ChangingThisActionIsNotAllowed string ChangingThisActionIsNotAllowed string
@ -1419,6 +1423,10 @@ func EnglishTranslationSet() *TranslationSet {
NoRoom: "Not enough room", NoRoom: "Not enough room",
YouAreHere: "YOU ARE HERE", YouAreHere: "YOU ARE HERE",
ConflictLabel: "CONFLICT", ConflictLabel: "CONFLICT",
PendingRebaseTodosSectionHeader: "Pending rebase todos",
PendingCherryPicksSectionHeader: "Pending cherry-picks",
PendingRevertsSectionHeader: "Pending reverts",
CommitsSectionHeader: "Commits",
YouDied: "YOU DIED!", YouDied: "YOU DIED!",
RewordNotSupported: "Rewording commits while interactively rebasing is not currently supported", RewordNotSupported: "Rewording commits while interactively rebasing is not currently supported",
ChangingThisActionIsNotAllowed: "Changing this kind of rebase todo entry is not allowed", ChangingThisActionIsNotAllowed: "Changing this kind of rebase todo entry is not allowed",

View File

@ -51,9 +51,11 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Commits(). t.Views().Commits().
Focus(). Focus().
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
MatchesRegexp(`pick.*to keep`).IsSelected(), MatchesRegexp(`pick.*to keep`).IsSelected(),
MatchesRegexp(`pick.*to remove`), MatchesRegexp(`pick.*to remove`),
MatchesRegexp(`pick.*CONFLICT.*first change`), MatchesRegexp(`pick.*CONFLICT.*first change`),
Contains("--- Commits ---"),
MatchesRegexp("second-change-branch unrelated change"), MatchesRegexp("second-change-branch unrelated change"),
MatchesRegexp("second change"), MatchesRegexp("second change"),
MatchesRegexp("original"), MatchesRegexp("original"),
@ -61,9 +63,11 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{
SelectNextItem(). SelectNextItem().
Press(keys.Universal.Remove). Press(keys.Universal.Remove).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
MatchesRegexp(`pick.*to keep`), MatchesRegexp(`pick.*to keep`),
MatchesRegexp(`drop.*to remove`).IsSelected(), MatchesRegexp(`drop.*to remove`).IsSelected(),
MatchesRegexp(`pick.*CONFLICT.*first change`), MatchesRegexp(`pick.*CONFLICT.*first change`),
Contains("--- Commits ---"),
MatchesRegexp("second-change-branch unrelated change"), MatchesRegexp("second-change-branch unrelated change"),
MatchesRegexp("second change"), MatchesRegexp("second change"),
MatchesRegexp("original"), MatchesRegexp("original"),

View File

@ -59,7 +59,9 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
SelectNextItem(). SelectNextItem().
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick CI two"), Contains("pick CI two"),
Contains("--- Commits ---"),
Contains(" CI <-- YOU ARE HERE --- one").IsSelected(), Contains(" CI <-- YOU ARE HERE --- one").IsSelected(),
Contains(" CI base"), Contains(" CI base"),
). ).
@ -74,7 +76,9 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Information().Content(DoesNotContain("commit copied")) t.Views().Information().Content(DoesNotContain("commit copied"))
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick CI two"), Contains("pick CI two"),
Contains("--- Commits ---"),
Contains(" CI <-- YOU ARE HERE --- three"), Contains(" CI <-- YOU ARE HERE --- three"),
Contains(" CI one"), Contains(" CI one"),
Contains(" CI base"), Contains(" CI base"),

View File

@ -29,8 +29,10 @@ var AmendWhenThereAreConflictsAndAmend = NewIntegrationTest(NewIntegrationTestAr
t.Views().Commits(). t.Views().Commits().
Focus(). Focus().
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit three"), Contains("pick").Contains("commit three"),
Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"), Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"),
Contains("--- Commits ---"),
Contains("commit two"), Contains("commit two"),
Contains("file1 changed in master"), Contains("file1 changed in master"),
Contains("base commit"), Contains("base commit"),

View File

@ -33,8 +33,10 @@ var AmendWhenThereAreConflictsAndCancel = NewIntegrationTest(NewIntegrationTestA
t.Views().Commits(). t.Views().Commits().
Focus(). Focus().
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit three"), Contains("pick").Contains("commit three"),
Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"), Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"),
Contains("--- Commits ---"),
Contains("commit two"), Contains("commit two"),
Contains("file1 changed in master"), Contains("file1 changed in master"),
Contains("base commit"), Contains("base commit"),

View File

@ -44,8 +44,10 @@ var RevertWithConflictMultipleCommits = NewIntegrationTest(NewIntegrationTestArg
Confirm() Confirm()
}). }).
Lines( Lines(
Contains("--- Pending reverts ---"),
Contains("revert").Contains("CI unrelated change"), Contains("revert").Contains("CI unrelated change"),
Contains("revert").Contains("CI <-- CONFLICT --- add first line"), Contains("revert").Contains("CI <-- CONFLICT --- add first line"),
Contains("--- Commits ---"),
Contains("CI ◯ add second line"), Contains("CI ◯ add second line"),
Contains("CI ◯ add first line"), Contains("CI ◯ add first line"),
Contains("CI ◯ unrelated change"), Contains("CI ◯ unrelated change"),

View File

@ -39,7 +39,9 @@ var RevertWithConflictSingleCommit = NewIntegrationTest(NewIntegrationTestArgs{
Confirm() Confirm()
}). }).
Lines( Lines(
Contains("--- Pending reverts ---"),
Contains("revert").Contains("CI <-- CONFLICT --- add first line"), Contains("revert").Contains("CI <-- CONFLICT --- add first line"),
Contains("--- Commits ---"),
Contains("CI ◯ add second line"), Contains("CI ◯ add second line"),
Contains("CI ◯ add first line"), Contains("CI ◯ add first line"),
Contains("CI ◯ add empty file"), Contains("CI ◯ add empty file"),

View File

@ -43,8 +43,10 @@ func doTheRebaseForAmendTests(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits(). t.Views().Commits().
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit three"), Contains("pick").Contains("commit three"),
Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"), Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"),
Contains("--- Commits ---"),
Contains("commit two"), Contains("commit two"),
Contains("file1 changed in master"), Contains("file1 changed in master"),
Contains("base commit"), Contains("base commit"),

View File

@ -45,19 +45,25 @@ var AdvancedInteractiveRebase = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Commits(). t.Views().Commits().
IsFocused(). IsFocused().
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains(TOP_COMMIT), Contains(TOP_COMMIT),
Contains("--- Commits ---"),
Contains(BASE_COMMIT).Contains("YOU ARE HERE"), Contains(BASE_COMMIT).Contains("YOU ARE HERE"),
). ).
NavigateToLine(Contains(TOP_COMMIT)). NavigateToLine(Contains(TOP_COMMIT)).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains(TOP_COMMIT).Contains("edit"), Contains(TOP_COMMIT).Contains("edit"),
Contains("--- Commits ---"),
Contains(BASE_COMMIT).Contains("YOU ARE HERE"), Contains(BASE_COMMIT).Contains("YOU ARE HERE"),
). ).
Tap(func() { Tap(func() {
t.Common().ContinueRebase() t.Common().ContinueRebase()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("--- Commits ---"),
Contains(TOP_COMMIT).Contains("YOU ARE HERE"), Contains(TOP_COMMIT).Contains("YOU ARE HERE"),
Contains(BASE_COMMIT), Contains(BASE_COMMIT),
) )

View File

@ -34,8 +34,10 @@ var AmendCommitWithConflict = NewIntegrationTest(NewIntegrationTestArgs{
t.Common().AcknowledgeConflicts() t.Common().AcknowledgeConflicts()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("three"), Contains("pick").Contains("three"),
Contains("fixup").Contains("<-- CONFLICT --- fixup! two"), Contains("fixup").Contains("<-- CONFLICT --- fixup! two"),
Contains("--- Commits ---"),
Contains("two"), Contains("two"),
Contains("one"), Contains("one"),
) )
@ -66,7 +68,9 @@ var AmendCommitWithConflict = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Commits(). t.Views().Commits().
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("<-- CONFLICT --- three"), Contains("<-- CONFLICT --- three"),
Contains("--- Commits ---"),
Contains("two"), Contains("two"),
Contains("one"), Contains("one"),
) )

View File

@ -24,7 +24,9 @@ var AmendHeadCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 02")). NavigateToLine(Contains("commit 02")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(), Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
Contains("commit 01"), Contains("commit 01"),
) )
@ -48,7 +50,9 @@ var AmendHeadCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
Confirm() Confirm()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(), Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
Contains("commit 01"), Contains("commit 01"),
) )

View File

@ -24,7 +24,9 @@ var AmendNonHeadCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 02")). NavigateToLine(Contains("commit 02")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 02"), Contains("<-- YOU ARE HERE --- commit 02"),
Contains("commit 01"), Contains("commit 01"),
) )

View File

@ -26,12 +26,14 @@ var DeleteUpdateRefTodo = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 01")). NavigateToLine(Contains("commit 01")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("CI commit 06"), Contains("pick").Contains("CI commit 06"),
Contains("pick").Contains("CI commit 05"), Contains("pick").Contains("CI commit 05"),
Contains("pick").Contains("CI commit 04"), Contains("pick").Contains("CI commit 04"),
Contains("update-ref").Contains("branch1"), Contains("update-ref").Contains("branch1"),
Contains("pick").Contains("CI commit 03"), Contains("pick").Contains("CI commit 03"),
Contains("pick").Contains("CI commit 02"), Contains("pick").Contains("CI commit 02"),
Contains("--- Commits ---"),
Contains("CI ◯ <-- YOU ARE HERE --- commit 01"), Contains("CI ◯ <-- YOU ARE HERE --- commit 01"),
). ).
NavigateToLine(Contains("update-ref")). NavigateToLine(Contains("update-ref")).
@ -43,11 +45,13 @@ var DeleteUpdateRefTodo = NewIntegrationTest(NewIntegrationTestArgs{
Confirm() Confirm()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("CI commit 06"), Contains("pick").Contains("CI commit 06"),
Contains("pick").Contains("CI commit 05"), Contains("pick").Contains("CI commit 05"),
Contains("pick").Contains("CI commit 04"), Contains("pick").Contains("CI commit 04"),
Contains("pick").Contains("CI commit 03").IsSelected(), Contains("pick").Contains("CI commit 03").IsSelected(),
Contains("pick").Contains("CI commit 02"), Contains("pick").Contains("CI commit 02"),
Contains("--- Commits ---"),
Contains("CI ◯ <-- YOU ARE HERE --- commit 01"), Contains("CI ◯ <-- YOU ARE HERE --- commit 01"),
). ).
NavigateToLine(Contains("commit 02")). NavigateToLine(Contains("commit 02")).

View File

@ -41,12 +41,14 @@ var DontShowBranchHeadsForTodoItems = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 04")). NavigateToLine(Contains("commit 04")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("CI commit 09"), Contains("pick").Contains("CI commit 09"),
Contains("pick").Contains("CI commit 08"), Contains("pick").Contains("CI commit 08"),
Contains("pick").Contains("CI commit 07"), Contains("pick").Contains("CI commit 07"),
Contains("update-ref").Contains("branch2"), Contains("update-ref").Contains("branch2"),
Contains("pick").Contains("CI commit 06"), // no star on this entry, even though branch2 points to it Contains("pick").Contains("CI commit 06"), // no star on this entry, even though branch2 points to it
Contains("pick").Contains("CI commit 05"), Contains("pick").Contains("CI commit 05"),
Contains("--- Commits ---"),
Contains("CI <-- YOU ARE HERE --- commit 04"), Contains("CI <-- YOU ARE HERE --- commit 04"),
Contains("CI commit 03"), Contains("CI commit 03"),
Contains("CI * commit 02"), // this star is fine though Contains("CI * commit 02"), // this star is fine though

View File

@ -39,12 +39,14 @@ var DropTodoCommitWithUpdateRef = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 02")). NavigateToLine(Contains("commit 02")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("CI commit 07"), Contains("pick").Contains("CI commit 07"),
Contains("pick").Contains("CI commit 06"), Contains("pick").Contains("CI commit 06"),
Contains("pick").Contains("CI commit 05"), Contains("pick").Contains("CI commit 05"),
Contains("update-ref").Contains("branch1").DoesNotContain("*"), Contains("update-ref").Contains("branch1").DoesNotContain("*"),
Contains("pick").Contains("CI commit 04"), Contains("pick").Contains("CI commit 04"),
Contains("pick").Contains("CI commit 03"), Contains("pick").Contains("CI commit 03"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(), Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
Contains("CI commit 01"), Contains("CI commit 01"),
). ).

View File

@ -25,7 +25,9 @@ var EditAndAutoAmend = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 02")). NavigateToLine(Contains("commit 02")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
MatchesRegexp("YOU ARE HERE.*commit 02").IsSelected(), MatchesRegexp("YOU ARE HERE.*commit 02").IsSelected(),
Contains("commit 01"), Contains("commit 01"),
) )

View File

@ -24,7 +24,9 @@ var EditFirstCommit = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 01")). NavigateToLine(Contains("commit 01")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 02"), Contains("commit 02"),
Contains("--- Commits ---"),
MatchesRegexp("YOU ARE HERE.*commit 01").IsSelected(), MatchesRegexp("YOU ARE HERE.*commit 01").IsSelected(),
). ).
Tap(func() { Tap(func() {

View File

@ -37,9 +37,11 @@ var EditLastCommitOfStackedBranch = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 03")). NavigateToLine(Contains("commit 03")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("CI commit 05"), Contains("pick").Contains("CI commit 05"),
Contains("pick").Contains("CI commit 04"), Contains("pick").Contains("CI commit 04"),
Contains("update-ref").Contains("branch1"), Contains("update-ref").Contains("branch1"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- * commit 03").IsSelected(), Contains("<-- YOU ARE HERE --- * commit 03").IsSelected(),
Contains("CI commit 02"), Contains("CI commit 02"),
Contains("CI commit 01"), Contains("CI commit 01"),

View File

@ -23,6 +23,8 @@ var EditNonTodoCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
). ).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 02"), Contains("<-- YOU ARE HERE --- commit 02"),
Contains("commit 01"), Contains("commit 01"),
). ).

View File

@ -27,8 +27,10 @@ var EditRangeSelectDownToMergeOutsideRebase = NewIntegrationTest(NewIntegrationT
Press(keys.Universal.RangeSelectDown). Press(keys.Universal.RangeSelectDown).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("edit CI commit 02").IsSelected(), Contains("edit CI commit 02").IsSelected(),
Contains("edit CI commit 01").IsSelected(), Contains("edit CI commit 01").IsSelected(),
Contains("--- Commits ---").IsSelected(),
Contains(" CI ⏣─╮ <-- YOU ARE HERE --- Merge branch 'second-change-branch' into first-change-branch").IsSelected(), Contains(" CI ⏣─╮ <-- YOU ARE HERE --- Merge branch 'second-change-branch' into first-change-branch").IsSelected(),
Contains(" CI │ ◯ * second-change-branch unrelated change"), Contains(" CI │ ◯ * second-change-branch unrelated change"),
Contains(" CI │ ◯ second change"), Contains(" CI │ ◯ second change"),

View File

@ -37,11 +37,13 @@ var EditRangeSelectOutsideRebase = NewIntegrationTest(NewIntegrationTestArgs{
). ).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("merge CI Merge branch 'second-change-branch' into first-change-branch").IsSelected(), Contains("merge CI Merge branch 'second-change-branch' into first-change-branch").IsSelected(),
Contains("edit CI first change").IsSelected(), Contains("edit CI first change").IsSelected(),
Contains("edit CI * second-change-branch unrelated change").IsSelected(), Contains("edit CI * second-change-branch unrelated change").IsSelected(),
Contains("edit CI second change").IsSelected(), Contains("edit CI second change").IsSelected(),
Contains("edit CI * original").IsSelected(), Contains("edit CI * original").IsSelected(),
Contains("--- Commits ---").IsSelected(),
Contains(" CI ◯ <-- YOU ARE HERE --- three").IsSelected(), Contains(" CI ◯ <-- YOU ARE HERE --- three").IsSelected(),
Contains(" CI ◯ two"), Contains(" CI ◯ two"),
Contains(" CI ◯ one"), Contains(" CI ◯ one"),

View File

@ -32,8 +32,10 @@ var EditTheConflCommit = NewIntegrationTest(NewIntegrationTestArgs{
}). }).
Focus(). Focus().
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit two"), Contains("pick").Contains("commit two"),
Contains("pick").Contains("<-- CONFLICT --- commit three"), Contains("pick").Contains("<-- CONFLICT --- commit three"),
Contains("--- Commits ---"),
Contains("commit one"), Contains("commit one"),
). ).
NavigateToLine(Contains("<-- CONFLICT --- commit three")). NavigateToLine(Contains("<-- CONFLICT --- commit three")).

View File

@ -32,9 +32,11 @@ var InteractiveRebaseOfCopiedBranch = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 01")). NavigateToLine(Contains("commit 01")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
// No update-ref todo for branch1 here, even though command-line git would have added it // No update-ref todo for branch1 here, even though command-line git would have added it
Contains("pick").Contains("CI commit 03"), Contains("pick").Contains("CI commit 03"),
Contains("pick").Contains("CI commit 02"), Contains("pick").Contains("CI commit 02"),
Contains("--- Commits ---"),
Contains("CI <-- YOU ARE HERE --- commit 01"), Contains("CI <-- YOU ARE HERE --- commit 01"),
) )
}, },

View File

@ -52,7 +52,9 @@ var InteractiveRebaseWithConflictForEditCommand = NewIntegrationTest(NewIntegrat
t.Views().Commits(). t.Views().Commits().
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("edit").Contains("<-- CONFLICT --- this will conflict").IsSelected(), Contains("edit").Contains("<-- CONFLICT --- this will conflict").IsSelected(),
Contains("--- Commits ---"),
Contains("commit 03"), Contains("commit 03"),
Contains("commit 02"), Contains("commit 02"),
Contains("commit 01"), Contains("commit 01"),

View File

@ -24,11 +24,13 @@ var MidRebaseRangeSelect = NewIntegrationTest(NewIntegrationTestArgs{
// Start a rebase // Start a rebase
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("pick").Contains("commit 08"), Contains("pick").Contains("commit 08"),
Contains("pick").Contains("commit 07"), Contains("pick").Contains("commit 07"),
Contains("pick").Contains("commit 06"), Contains("pick").Contains("commit 06"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 05").IsSelected(), Contains("<-- YOU ARE HERE --- commit 05").IsSelected(),
Contains("commit 04"), Contains("commit 04"),
). ).
@ -36,61 +38,73 @@ var MidRebaseRangeSelect = NewIntegrationTest(NewIntegrationTestArgs{
// perform various actions on a range of commits // perform various actions on a range of commits
Press(keys.Universal.RangeSelectUp). Press(keys.Universal.RangeSelectUp).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("pick").Contains("commit 08"), Contains("pick").Contains("commit 08"),
Contains("pick").Contains("commit 07").IsSelected(), Contains("pick").Contains("commit 07").IsSelected(),
Contains("pick").Contains("commit 06").IsSelected(), Contains("pick").Contains("commit 06").IsSelected(),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 05"), Contains("<-- YOU ARE HERE --- commit 05"),
Contains("commit 04"), Contains("commit 04"),
). ).
Press(keys.Commits.MarkCommitAsFixup). Press(keys.Commits.MarkCommitAsFixup).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("pick").Contains("commit 08"), Contains("pick").Contains("commit 08"),
Contains("fixup").Contains("commit 07").IsSelected(), Contains("fixup").Contains("commit 07").IsSelected(),
Contains("fixup").Contains("commit 06").IsSelected(), Contains("fixup").Contains("commit 06").IsSelected(),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 05"), Contains("<-- YOU ARE HERE --- commit 05"),
Contains("commit 04"), Contains("commit 04"),
). ).
Press(keys.Commits.PickCommit). Press(keys.Commits.PickCommit).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("pick").Contains("commit 08"), Contains("pick").Contains("commit 08"),
Contains("pick").Contains("commit 07").IsSelected(), Contains("pick").Contains("commit 07").IsSelected(),
Contains("pick").Contains("commit 06").IsSelected(), Contains("pick").Contains("commit 06").IsSelected(),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 05"), Contains("<-- YOU ARE HERE --- commit 05"),
Contains("commit 04"), Contains("commit 04"),
). ).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("pick").Contains("commit 08"), Contains("pick").Contains("commit 08"),
Contains("edit").Contains("commit 07").IsSelected(), Contains("edit").Contains("commit 07").IsSelected(),
Contains("edit").Contains("commit 06").IsSelected(), Contains("edit").Contains("commit 06").IsSelected(),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 05"), Contains("<-- YOU ARE HERE --- commit 05"),
Contains("commit 04"), Contains("commit 04"),
). ).
Press(keys.Commits.SquashDown). Press(keys.Commits.SquashDown).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("pick").Contains("commit 08"), Contains("pick").Contains("commit 08"),
Contains("squash").Contains("commit 07").IsSelected(), Contains("squash").Contains("commit 07").IsSelected(),
Contains("squash").Contains("commit 06").IsSelected(), Contains("squash").Contains("commit 06").IsSelected(),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 05"), Contains("<-- YOU ARE HERE --- commit 05"),
Contains("commit 04"), Contains("commit 04"),
). ).
Press(keys.Commits.MoveDownCommit). Press(keys.Commits.MoveDownCommit).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("pick").Contains("commit 08"), Contains("pick").Contains("commit 08"),
Contains("squash").Contains("commit 07").IsSelected(), Contains("squash").Contains("commit 07").IsSelected(),
Contains("squash").Contains("commit 06").IsSelected(), Contains("squash").Contains("commit 06").IsSelected(),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 05"), Contains("<-- YOU ARE HERE --- commit 05"),
Contains("commit 04"), Contains("commit 04"),
). ).
@ -99,31 +113,37 @@ var MidRebaseRangeSelect = NewIntegrationTest(NewIntegrationTestArgs{
}). }).
Press(keys.Commits.MoveUpCommit). Press(keys.Commits.MoveUpCommit).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("squash").Contains("commit 07").IsSelected(), Contains("squash").Contains("commit 07").IsSelected(),
Contains("squash").Contains("commit 06").IsSelected(), Contains("squash").Contains("commit 06").IsSelected(),
Contains("pick").Contains("commit 08"), Contains("pick").Contains("commit 08"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 05"), Contains("<-- YOU ARE HERE --- commit 05"),
Contains("commit 04"), Contains("commit 04"),
). ).
Press(keys.Commits.MoveUpCommit). Press(keys.Commits.MoveUpCommit).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("squash").Contains("commit 07").IsSelected(), Contains("squash").Contains("commit 07").IsSelected(),
Contains("squash").Contains("commit 06").IsSelected(), Contains("squash").Contains("commit 06").IsSelected(),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("pick").Contains("commit 08"), Contains("pick").Contains("commit 08"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 05"), Contains("<-- YOU ARE HERE --- commit 05"),
Contains("commit 04"), Contains("commit 04"),
). ).
Press(keys.Commits.MoveUpCommit). Press(keys.Commits.MoveUpCommit).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("squash").Contains("commit 07").IsSelected(), Contains("squash").Contains("commit 07").IsSelected(),
Contains("squash").Contains("commit 06").IsSelected(), Contains("squash").Contains("commit 06").IsSelected(),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("pick").Contains("commit 08"), Contains("pick").Contains("commit 08"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 05"), Contains("<-- YOU ARE HERE --- commit 05"),
Contains("commit 04"), Contains("commit 04"),
). ).
@ -132,11 +152,13 @@ var MidRebaseRangeSelect = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectToast(Contains("Disabled: Cannot move any further")) t.ExpectToast(Contains("Disabled: Cannot move any further"))
}). }).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("squash").Contains("commit 07").IsSelected(), Contains("squash").Contains("commit 07").IsSelected(),
Contains("squash").Contains("commit 06").IsSelected(), Contains("squash").Contains("commit 06").IsSelected(),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("pick").Contains("commit 08"), Contains("pick").Contains("commit 08"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 05"), Contains("<-- YOU ARE HERE --- commit 05"),
Contains("commit 04"), Contains("commit 04"),
). ).
@ -145,11 +167,13 @@ var MidRebaseRangeSelect = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 08")). NavigateToLine(Contains("commit 08")).
Press(keys.Universal.RangeSelectDown). Press(keys.Universal.RangeSelectDown).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("squash").Contains("commit 07"), Contains("squash").Contains("commit 07"),
Contains("squash").Contains("commit 06"), Contains("squash").Contains("commit 06"),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("pick").Contains("commit 08").IsSelected(), Contains("pick").Contains("commit 08").IsSelected(),
Contains("--- Commits ---").IsSelected(),
Contains("<-- YOU ARE HERE --- commit 05").IsSelected(), Contains("<-- YOU ARE HERE --- commit 05").IsSelected(),
Contains("commit 04"), Contains("commit 04"),
). ).
@ -158,11 +182,13 @@ var MidRebaseRangeSelect = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectToast(Contains("Disabled: When rebasing, this action only works on a selection of TODO commits.")) t.ExpectToast(Contains("Disabled: When rebasing, this action only works on a selection of TODO commits."))
}). }).
TopLines( TopLines(
Contains("--- Pending rebase todos ---"),
Contains("squash").Contains("commit 07"), Contains("squash").Contains("commit 07"),
Contains("squash").Contains("commit 06"), Contains("squash").Contains("commit 06"),
Contains("pick").Contains("commit 10"), Contains("pick").Contains("commit 10"),
Contains("pick").Contains("commit 09"), Contains("pick").Contains("commit 09"),
Contains("pick").Contains("commit 08").IsSelected(), Contains("pick").Contains("commit 08").IsSelected(),
Contains("--- Commits ---").IsSelected(),
Contains("<-- YOU ARE HERE --- commit 05").IsSelected(), Contains("<-- YOU ARE HERE --- commit 05").IsSelected(),
Contains("commit 04"), Contains("commit 04"),
). ).

View File

@ -25,24 +25,30 @@ var MoveInRebase = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 01")). NavigateToLine(Contains("commit 01")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 04"), Contains("commit 04"),
Contains("commit 03"), Contains("commit 03"),
Contains("commit 02"), Contains("commit 02"),
Contains("--- Commits ---"),
Contains("YOU ARE HERE").Contains("commit 01").IsSelected(), Contains("YOU ARE HERE").Contains("commit 01").IsSelected(),
). ).
SelectPreviousItem(). SelectPreviousItem().
Press(keys.Commits.MoveUpCommit). Press(keys.Commits.MoveUpCommit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 04"), Contains("commit 04"),
Contains("commit 02").IsSelected(), Contains("commit 02").IsSelected(),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("YOU ARE HERE").Contains("commit 01"), Contains("YOU ARE HERE").Contains("commit 01"),
). ).
Press(keys.Commits.MoveUpCommit). Press(keys.Commits.MoveUpCommit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 02").IsSelected(), Contains("commit 02").IsSelected(),
Contains("commit 04"), Contains("commit 04"),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("YOU ARE HERE").Contains("commit 01"), Contains("YOU ARE HERE").Contains("commit 01"),
). ).
// assert we can't move past the top // assert we can't move past the top
@ -51,23 +57,29 @@ var MoveInRebase = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectToast(Contains("Disabled: Cannot move any further")) t.ExpectToast(Contains("Disabled: Cannot move any further"))
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 02").IsSelected(), Contains("commit 02").IsSelected(),
Contains("commit 04"), Contains("commit 04"),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("YOU ARE HERE").Contains("commit 01"), Contains("YOU ARE HERE").Contains("commit 01"),
). ).
Press(keys.Commits.MoveDownCommit). Press(keys.Commits.MoveDownCommit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 04"), Contains("commit 04"),
Contains("commit 02").IsSelected(), Contains("commit 02").IsSelected(),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("YOU ARE HERE").Contains("commit 01"), Contains("YOU ARE HERE").Contains("commit 01"),
). ).
Press(keys.Commits.MoveDownCommit). Press(keys.Commits.MoveDownCommit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 04"), Contains("commit 04"),
Contains("commit 03"), Contains("commit 03"),
Contains("commit 02").IsSelected(), Contains("commit 02").IsSelected(),
Contains("--- Commits ---"),
Contains("YOU ARE HERE").Contains("commit 01"), Contains("YOU ARE HERE").Contains("commit 01"),
). ).
// assert we can't move past the bottom // assert we can't move past the bottom
@ -76,17 +88,21 @@ var MoveInRebase = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectToast(Contains("Disabled: Cannot move any further")) t.ExpectToast(Contains("Disabled: Cannot move any further"))
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 04"), Contains("commit 04"),
Contains("commit 03"), Contains("commit 03"),
Contains("commit 02").IsSelected(), Contains("commit 02").IsSelected(),
Contains("--- Commits ---"),
Contains("YOU ARE HERE").Contains("commit 01"), Contains("YOU ARE HERE").Contains("commit 01"),
). ).
// move it back up one so that we land in a different order than we started with // move it back up one so that we land in a different order than we started with
Press(keys.Commits.MoveUpCommit). Press(keys.Commits.MoveUpCommit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 04"), Contains("commit 04"),
Contains("commit 02").IsSelected(), Contains("commit 02").IsSelected(),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("YOU ARE HERE").Contains("commit 01"), Contains("YOU ARE HERE").Contains("commit 01"),
). ).
Tap(func() { Tap(func() {

View File

@ -26,24 +26,28 @@ var MoveUpdateRefTodo = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 01")). NavigateToLine(Contains("commit 01")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("CI commit 06"), Contains("pick").Contains("CI commit 06"),
Contains("pick").Contains("CI commit 05"), Contains("pick").Contains("CI commit 05"),
Contains("pick").Contains("CI commit 04"), Contains("pick").Contains("CI commit 04"),
Contains("update-ref").Contains("branch1"), Contains("update-ref").Contains("branch1"),
Contains("pick").Contains("CI commit 03"), Contains("pick").Contains("CI commit 03"),
Contains("pick").Contains("CI commit 02"), Contains("pick").Contains("CI commit 02"),
Contains("--- Commits ---"),
Contains("CI ◯ <-- YOU ARE HERE --- commit 01"), Contains("CI ◯ <-- YOU ARE HERE --- commit 01"),
). ).
NavigateToLine(Contains("update-ref")). NavigateToLine(Contains("update-ref")).
Press(keys.Commits.MoveUpCommit). Press(keys.Commits.MoveUpCommit).
Press(keys.Commits.MoveUpCommit). Press(keys.Commits.MoveUpCommit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("CI commit 06"), Contains("pick").Contains("CI commit 06"),
Contains("update-ref").Contains("branch1"), Contains("update-ref").Contains("branch1"),
Contains("pick").Contains("CI commit 05"), Contains("pick").Contains("CI commit 05"),
Contains("pick").Contains("CI commit 04"), Contains("pick").Contains("CI commit 04"),
Contains("pick").Contains("CI commit 03"), Contains("pick").Contains("CI commit 03"),
Contains("pick").Contains("CI commit 02"), Contains("pick").Contains("CI commit 02"),
Contains("--- Commits ---"),
Contains("CI ◯ <-- YOU ARE HERE --- commit 01"), Contains("CI ◯ <-- YOU ARE HERE --- commit 01"),
). ).
Tap(func() { Tap(func() {

View File

@ -26,8 +26,10 @@ var PickRescheduled = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("one")). NavigateToLine(Contains("one")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("three"), Contains("pick").Contains("three"),
Contains("pick").Contains("two"), Contains("pick").Contains("two"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- one").IsSelected(), Contains("<-- YOU ARE HERE --- one").IsSelected(),
). ).
Tap(func() { Tap(func() {
@ -39,7 +41,9 @@ var PickRescheduled = NewIntegrationTest(NewIntegrationTestArgs{
Confirm() Confirm()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("three"), Contains("pick").Contains("three"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- two"), Contains("<-- YOU ARE HERE --- two"),
Contains("one"), Contains("one"),
) )

View File

@ -73,8 +73,10 @@ var QuickStart = NewIntegrationTest(NewIntegrationTestArgs{
// Verify quick start picks the last commit on the main branch // Verify quick start picks the last commit on the main branch
Press(keys.Commits.StartInteractiveRebase). Press(keys.Commits.StartInteractiveRebase).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("feature-branch two").IsSelected(), Contains("feature-branch two").IsSelected(),
Contains("feature-branch one"), Contains("feature-branch one"),
Contains("--- Commits ---"),
Contains("last main commit").Contains("YOU ARE HERE"), Contains("last main commit").Contains("YOU ARE HERE"),
Contains("initial commit"), Contains("initial commit"),
). ).
@ -104,7 +106,9 @@ var QuickStart = NewIntegrationTest(NewIntegrationTestArgs{
). ).
Press(keys.Commits.StartInteractiveRebase). Press(keys.Commits.StartInteractiveRebase).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("branch-with-merge three").IsSelected(), Contains("branch-with-merge three").IsSelected(),
Contains("--- Commits ---"),
Contains("Merge branch 'branch-to-merge'").Contains("YOU ARE HERE"), Contains("Merge branch 'branch-to-merge'").Contains("YOU ARE HERE"),
Contains("branch-to-merge two"), Contains("branch-to-merge two"),
Contains("branch-to-merge one"), Contains("branch-to-merge one"),

View File

@ -39,6 +39,7 @@ var QuickStartKeepSelection = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 02")). NavigateToLine(Contains("commit 02")).
Press(keys.Commits.StartInteractiveRebase). Press(keys.Commits.StartInteractiveRebase).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("CI commit 07"), Contains("pick").Contains("CI commit 07"),
Contains("pick").Contains("CI commit 06"), Contains("pick").Contains("CI commit 06"),
Contains("pick").Contains("CI commit 05"), Contains("pick").Contains("CI commit 05"),
@ -46,6 +47,7 @@ var QuickStartKeepSelection = NewIntegrationTest(NewIntegrationTestArgs{
Contains("pick").Contains("CI commit 04"), Contains("pick").Contains("CI commit 04"),
Contains("pick").Contains("CI commit 03"), Contains("pick").Contains("CI commit 03"),
Contains("CI commit 02").IsSelected(), Contains("CI commit 02").IsSelected(),
Contains("--- Commits ---"),
Contains("CI <-- YOU ARE HERE --- commit 01"), Contains("CI <-- YOU ARE HERE --- commit 01"),
) )
}, },

View File

@ -43,6 +43,7 @@ var QuickStartKeepSelectionRange = NewIntegrationTest(NewIntegrationTestArgs{
). ).
Press(keys.Commits.StartInteractiveRebase). Press(keys.Commits.StartInteractiveRebase).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("CI commit 07"), Contains("CI commit 07"),
Contains("CI commit 06"), Contains("CI commit 06"),
Contains("update-ref").Contains("branch2"), Contains("update-ref").Contains("branch2"),
@ -51,6 +52,7 @@ var QuickStartKeepSelectionRange = NewIntegrationTest(NewIntegrationTestArgs{
Contains("update-ref").Contains("branch1").IsSelected(), Contains("update-ref").Contains("branch1").IsSelected(),
Contains("CI commit 03").IsSelected(), Contains("CI commit 03").IsSelected(),
Contains("CI commit 02").IsSelected(), Contains("CI commit 02").IsSelected(),
Contains("--- Commits ---"),
Contains("CI <-- YOU ARE HERE --- commit 01"), Contains("CI <-- YOU ARE HERE --- commit 01"),
) )
}, },

View File

@ -34,50 +34,60 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("first commit to edit")). NavigateToLine(Contains("first commit to edit")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
MatchesRegexp("pick.*commit to fixup"), MatchesRegexp("pick.*commit to fixup"),
MatchesRegexp("pick.*commit to drop"), MatchesRegexp("pick.*commit to drop"),
MatchesRegexp("pick.*second commit to edit"), MatchesRegexp("pick.*second commit to edit"),
MatchesRegexp("pick.*commit to squash"), MatchesRegexp("pick.*commit to squash"),
Contains("--- Commits ---"),
MatchesRegexp("YOU ARE HERE.*first commit to edit").IsSelected(), MatchesRegexp("YOU ARE HERE.*first commit to edit").IsSelected(),
Contains("initial commit"), Contains("initial commit"),
). ).
SelectPreviousItem(). SelectPreviousItem().
Press(keys.Commits.SquashDown). Press(keys.Commits.SquashDown).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
MatchesRegexp("pick.*commit to fixup"), MatchesRegexp("pick.*commit to fixup"),
MatchesRegexp("pick.*commit to drop"), MatchesRegexp("pick.*commit to drop"),
MatchesRegexp("pick.*second commit to edit"), MatchesRegexp("pick.*second commit to edit"),
MatchesRegexp("squash.*commit to squash").IsSelected(), MatchesRegexp("squash.*commit to squash").IsSelected(),
Contains("--- Commits ---"),
MatchesRegexp("YOU ARE HERE.*first commit to edit"), MatchesRegexp("YOU ARE HERE.*first commit to edit"),
Contains("initial commit"), Contains("initial commit"),
). ).
SelectPreviousItem(). SelectPreviousItem().
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
MatchesRegexp("pick.*commit to fixup"), MatchesRegexp("pick.*commit to fixup"),
MatchesRegexp("pick.*commit to drop"), MatchesRegexp("pick.*commit to drop"),
MatchesRegexp("edit.*second commit to edit").IsSelected(), MatchesRegexp("edit.*second commit to edit").IsSelected(),
MatchesRegexp("squash.*commit to squash"), MatchesRegexp("squash.*commit to squash"),
Contains("--- Commits ---"),
MatchesRegexp("YOU ARE HERE.*first commit to edit"), MatchesRegexp("YOU ARE HERE.*first commit to edit"),
Contains("initial commit"), Contains("initial commit"),
). ).
SelectPreviousItem(). SelectPreviousItem().
Press(keys.Universal.Remove). Press(keys.Universal.Remove).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
MatchesRegexp("pick.*commit to fixup"), MatchesRegexp("pick.*commit to fixup"),
MatchesRegexp("drop.*commit to drop").IsSelected(), MatchesRegexp("drop.*commit to drop").IsSelected(),
MatchesRegexp("edit.*second commit to edit"), MatchesRegexp("edit.*second commit to edit"),
MatchesRegexp("squash.*commit to squash"), MatchesRegexp("squash.*commit to squash"),
Contains("--- Commits ---"),
MatchesRegexp("YOU ARE HERE.*first commit to edit"), MatchesRegexp("YOU ARE HERE.*first commit to edit"),
Contains("initial commit"), Contains("initial commit"),
). ).
SelectPreviousItem(). SelectPreviousItem().
Press(keys.Commits.MarkCommitAsFixup). Press(keys.Commits.MarkCommitAsFixup).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
MatchesRegexp("fixup.*commit to fixup").IsSelected(), MatchesRegexp("fixup.*commit to fixup").IsSelected(),
MatchesRegexp("drop.*commit to drop"), MatchesRegexp("drop.*commit to drop"),
MatchesRegexp("edit.*second commit to edit"), MatchesRegexp("edit.*second commit to edit"),
MatchesRegexp("squash.*commit to squash"), MatchesRegexp("squash.*commit to squash"),
Contains("--- Commits ---"),
MatchesRegexp("YOU ARE HERE.*first commit to edit"), MatchesRegexp("YOU ARE HERE.*first commit to edit"),
Contains("initial commit"), Contains("initial commit"),
). ).
@ -85,8 +95,10 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{
t.Common().ContinueRebase() t.Common().ContinueRebase()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
MatchesRegexp("fixup.*commit to fixup").IsSelected(), MatchesRegexp("fixup.*commit to fixup").IsSelected(),
MatchesRegexp("drop.*commit to drop"), MatchesRegexp("drop.*commit to drop"),
Contains("--- Commits ---"),
MatchesRegexp("YOU ARE HERE.*second commit to edit"), MatchesRegexp("YOU ARE HERE.*second commit to edit"),
MatchesRegexp("first commit to edit"), MatchesRegexp("first commit to edit"),
Contains("initial commit"), Contains("initial commit"),

View File

@ -30,7 +30,9 @@ var RevertDuringRebaseWhenStoppedOnEdit = NewIntegrationTest(NewIntegrationTestA
NavigateToLine(Contains("commit 03")). NavigateToLine(Contains("commit 03")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit 04"), Contains("pick").Contains("commit 04"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 03").IsSelected(), Contains("<-- YOU ARE HERE --- commit 03").IsSelected(),
Contains("commit 02"), Contains("commit 02"),
Contains("commit 01"), Contains("commit 01"),
@ -47,7 +49,9 @@ var RevertDuringRebaseWhenStoppedOnEdit = NewIntegrationTest(NewIntegrationTestA
Confirm() Confirm()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit 04"), Contains("pick").Contains("commit 04"),
Contains("--- Commits ---"),
Contains(`<-- YOU ARE HERE --- Revert "commit 01"`), Contains(`<-- YOU ARE HERE --- Revert "commit 01"`),
Contains(`Revert "commit 02"`), Contains(`Revert "commit 02"`),
Contains("commit 03"), Contains("commit 03"),

View File

@ -50,10 +50,13 @@ var RevertMultipleCommitsInInteractiveRebase = NewIntegrationTest(NewIntegration
Confirm() Confirm()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("CI unrelated change 3"), Contains("CI unrelated change 3"),
Contains("CI unrelated change 2"), Contains("CI unrelated change 2"),
Contains("--- Pending reverts ---"),
Contains("revert").Contains("CI unrelated change 1"), Contains("revert").Contains("CI unrelated change 1"),
Contains("revert").Contains("CI <-- CONFLICT --- add first line"), Contains("revert").Contains("CI <-- CONFLICT --- add first line"),
Contains("--- Commits ---"),
Contains("CI ◯ add second line"), Contains("CI ◯ add second line"),
Contains("CI ◯ add first line"), Contains("CI ◯ add first line"),
Contains("CI ◯ unrelated change 1"), Contains("CI ◯ unrelated change 1"),
@ -80,8 +83,10 @@ var RevertMultipleCommitsInInteractiveRebase = NewIntegrationTest(NewIntegration
t.Views().Commits(). t.Views().Commits().
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("CI unrelated change 3"), Contains("pick").Contains("CI unrelated change 3"),
Contains("pick").Contains("CI unrelated change 2"), Contains("pick").Contains("CI unrelated change 2"),
Contains("--- Commits ---"),
Contains(`CI ◯ <-- YOU ARE HERE --- Revert "unrelated change 1"`), Contains(`CI ◯ <-- YOU ARE HERE --- Revert "unrelated change 1"`),
Contains(`CI ◯ Revert "add first line"`), Contains(`CI ◯ Revert "add first line"`),
Contains("CI ◯ add second line"), Contains("CI ◯ add second line"),

View File

@ -45,9 +45,12 @@ var RevertSingleCommitInInteractiveRebase = NewIntegrationTest(NewIntegrationTes
Cancel() // stay in commits panel Cancel() // stay in commits panel
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("CI unrelated change 2"), Contains("CI unrelated change 2"),
Contains("CI unrelated change 1"), Contains("CI unrelated change 1"),
Contains("--- Pending reverts ---"),
Contains("revert").Contains("CI <-- CONFLICT --- add first line"), Contains("revert").Contains("CI <-- CONFLICT --- add first line"),
Contains("--- Commits ---"),
Contains("CI ◯ add second line"), Contains("CI ◯ add second line"),
Contains("CI ◯ add first line").IsSelected(), Contains("CI ◯ add first line").IsSelected(),
Contains("CI ◯ add empty file"), Contains("CI ◯ add empty file"),
@ -81,8 +84,10 @@ var RevertSingleCommitInInteractiveRebase = NewIntegrationTest(NewIntegrationTes
t.Views().Commits(). t.Views().Commits().
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("CI unrelated change 2"), Contains("pick").Contains("CI unrelated change 2"),
Contains("pick").Contains("CI unrelated change 1"), Contains("pick").Contains("CI unrelated change 1"),
Contains("--- Commits ---"),
Contains(`CI ◯ <-- YOU ARE HERE --- Revert "add first line"`), Contains(`CI ◯ <-- YOU ARE HERE --- Revert "add first line"`),
Contains("CI ◯ add second line"), Contains("CI ◯ add second line"),
Contains("CI ◯ add first line"), Contains("CI ◯ add first line"),

View File

@ -33,7 +33,9 @@ var RewordCommitWithEditorAndFail = NewIntegrationTest(NewIntegrationTestArgs{
Confirm() Confirm()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(), Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
Contains("commit 01"), Contains("commit 01"),
) )

View File

@ -25,7 +25,9 @@ var RewordYouAreHereCommit = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit 02")). NavigateToLine(Contains("commit 02")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(), Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
Contains("commit 01"), Contains("commit 01"),
). ).
@ -39,7 +41,9 @@ var RewordYouAreHereCommit = NewIntegrationTest(NewIntegrationTestArgs{
Confirm() Confirm()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- renamed 02").IsSelected(), Contains("<-- YOU ARE HERE --- renamed 02").IsSelected(),
Contains("commit 01"), Contains("commit 01"),
) )

View File

@ -27,7 +27,9 @@ var RewordYouAreHereCommitWithEditor = NewIntegrationTest(NewIntegrationTestArgs
NavigateToLine(Contains("commit 02")). NavigateToLine(Contains("commit 02")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(), Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
Contains("commit 01"), Contains("commit 01"),
). ).
@ -39,7 +41,9 @@ var RewordYouAreHereCommitWithEditor = NewIntegrationTest(NewIntegrationTestArgs
Confirm() Confirm()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit 03"), Contains("commit 03"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- renamed 02").IsSelected(), Contains("<-- YOU ARE HERE --- renamed 02").IsSelected(),
Contains("commit 01"), Contains("commit 01"),
) )

View File

@ -9,8 +9,10 @@ func handleConflictsFromSwap(t *TestDriver, expectedCommand string) {
t.Views().Commits(). t.Views().Commits().
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("commit two"), Contains("pick").Contains("commit two"),
Contains(expectedCommand).Contains("<-- CONFLICT --- commit three"), Contains(expectedCommand).Contains("<-- CONFLICT --- commit three"),
Contains("--- Commits ---"),
Contains("commit one"), Contains("commit one"),
) )

View File

@ -31,8 +31,10 @@ var ShowExecTodos = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectPopup().Alert().Title(Equals("Error")).Content(Contains("Rebasing (2/4)Executing: false")).Confirm() t.ExpectPopup().Alert().Title(Equals("Error")).Content(Contains("Rebasing (2/4)Executing: false")).Confirm()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("exec").Contains("false"), Contains("exec").Contains("false"),
Contains("pick").Contains("CI commit 03"), Contains("pick").Contains("CI commit 03"),
Contains("--- Commits ---"),
Contains("CI ◯ <-- YOU ARE HERE --- commit 02"), Contains("CI ◯ <-- YOU ARE HERE --- commit 02"),
Contains("CI ◯ commit 01"), Contains("CI ◯ commit 01"),
). ).
@ -41,6 +43,8 @@ var ShowExecTodos = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectPopup().Alert().Title(Equals("Error")).Content(Contains("exit status 1")).Confirm() t.ExpectPopup().Alert().Title(Equals("Error")).Content(Contains("exit status 1")).Confirm()
}). }).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("--- Commits ---"),
Contains("CI ◯ <-- YOU ARE HERE --- commit 03"), Contains("CI ◯ <-- YOU ARE HERE --- commit 03"),
Contains("CI ◯ commit 02"), Contains("CI ◯ commit 02"),
Contains("CI ◯ commit 01"), Contains("CI ◯ commit 01"),

View File

@ -29,15 +29,19 @@ var SwapInRebaseWithConflict = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit one")). NavigateToLine(Contains("commit one")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit three"), Contains("commit three"),
Contains("commit two"), Contains("commit two"),
Contains("--- Commits ---"),
Contains("YOU ARE HERE").Contains("commit one").IsSelected(), Contains("YOU ARE HERE").Contains("commit one").IsSelected(),
). ).
SelectPreviousItem(). SelectPreviousItem().
Press(keys.Commits.MoveUpCommit). Press(keys.Commits.MoveUpCommit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit two").IsSelected(), Contains("commit two").IsSelected(),
Contains("commit three"), Contains("commit three"),
Contains("--- Commits ---"),
Contains("YOU ARE HERE").Contains("commit one"), Contains("YOU ARE HERE").Contains("commit one"),
). ).
Tap(func() { Tap(func() {

View File

@ -29,15 +29,19 @@ var SwapInRebaseWithConflictAndEdit = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("commit one")). NavigateToLine(Contains("commit one")).
Press(keys.Universal.Edit). Press(keys.Universal.Edit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit three"), Contains("commit three"),
Contains("commit two"), Contains("commit two"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit one").IsSelected(), Contains("<-- YOU ARE HERE --- commit one").IsSelected(),
). ).
NavigateToLine(Contains("commit two")). NavigateToLine(Contains("commit two")).
Press(keys.Commits.MoveUpCommit). Press(keys.Commits.MoveUpCommit).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("commit two").IsSelected(), Contains("commit two").IsSelected(),
Contains("commit three"), Contains("commit three"),
Contains("--- Commits ---"),
Contains("<-- YOU ARE HERE --- commit one"), Contains("<-- YOU ARE HERE --- commit one"),
). ).
NavigateToLine(Contains("commit three")). NavigateToLine(Contains("commit three")).

View File

@ -28,9 +28,11 @@ var ViewFilesOfTodoEntries = NewIntegrationTest(NewIntegrationTestArgs{
Focus(). Focus().
Press(keys.Commits.StartInteractiveRebase). Press(keys.Commits.StartInteractiveRebase).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("CI commit 03").IsSelected(), Contains("pick").Contains("CI commit 03").IsSelected(),
Contains("update-ref").Contains("branch1"), Contains("update-ref").Contains("branch1"),
Contains("pick").Contains("CI commit 02"), Contains("pick").Contains("CI commit 02"),
Contains("--- Commits ---"),
Contains("CI <-- YOU ARE HERE --- commit 01"), Contains("CI <-- YOU ARE HERE --- commit 01"),
). ).
Press(keys.Universal.GoInto) Press(keys.Universal.GoInto)

View File

@ -48,8 +48,10 @@ var PullRebaseInteractiveConflict = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Commits(). t.Views().Commits().
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("five"), Contains("pick").Contains("five"),
Contains("pick").Contains("CONFLICT").Contains("four"), Contains("pick").Contains("CONFLICT").Contains("four"),
Contains("--- Commits ---"),
Contains("three"), Contains("three"),
Contains("two"), Contains("two"),
Contains("one"), Contains("one"),

View File

@ -49,16 +49,20 @@ var PullRebaseInteractiveConflictDrop = NewIntegrationTest(NewIntegrationTestArg
t.Views().Commits(). t.Views().Commits().
Focus(). Focus().
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("pick").Contains("five").IsSelected(), Contains("pick").Contains("five").IsSelected(),
Contains("pick").Contains("CONFLICT").Contains("four"), Contains("pick").Contains("CONFLICT").Contains("four"),
Contains("--- Commits ---"),
Contains("three"), Contains("three"),
Contains("two"), Contains("two"),
Contains("one"), Contains("one"),
). ).
Press(keys.Universal.Remove). Press(keys.Universal.Remove).
Lines( Lines(
Contains("--- Pending rebase todos ---"),
Contains("drop").Contains("five").IsSelected(), Contains("drop").Contains("five").IsSelected(),
Contains("pick").Contains("CONFLICT").Contains("four"), Contains("pick").Contains("CONFLICT").Contains("four"),
Contains("--- Commits ---"),
Contains("three"), Contains("three"),
Contains("two"), Contains("two"),
Contains("one"), Contains("one"),