summaryrefslogtreecommitdiffstats
path: root/pkg/integration
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-12-29 14:27:48 +0100
committerStefan Haller <stefan@haller-berlin.de>2024-01-19 09:25:07 +0100
commit2c9b4770bcf2fbea44737a40adf872d0bbb89741 (patch)
tree50ea6f547be69521e5fbd00235241767c9568c55 /pkg/integration
parent98671802020883be6b3e10268db8542bf6c00324 (diff)
Keep same branch selected when refreshing branches
This wasn't necessary before, because the only available branch sorting option was by recency, so the sort order couldn't change except by checking out branches. Now, you can sort by committer date, so the branch order can change by fetching; in this case it's important to keep the same branch selected. One important use case is to rebase the checked-out branch onto master; you select master, press "f" to fetch it (this can now change its position in the list), and then press "r" to rebase. To make this work smoothly it's important to keep master selected after pressing "f".
Diffstat (limited to 'pkg/integration')
-rw-r--r--pkg/integration/tests/custom_commands/suggestions_command.go4
-rw-r--r--pkg/integration/tests/custom_commands/suggestions_preset.go4
-rw-r--r--pkg/integration/tests/sync/fetch_when_sorted_by_date.go5
3 files changed, 4 insertions, 9 deletions
diff --git a/pkg/integration/tests/custom_commands/suggestions_command.go b/pkg/integration/tests/custom_commands/suggestions_command.go
index f54ec1bae..592c472cf 100644
--- a/pkg/integration/tests/custom_commands/suggestions_command.go
+++ b/pkg/integration/tests/custom_commands/suggestions_command.go
@@ -57,8 +57,8 @@ var SuggestionsCommand = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Branches().
Lines(
- Contains("branch-three").IsSelected(),
- Contains("branch-four"),
+ Contains("branch-three"),
+ Contains("branch-four").IsSelected(),
Contains("branch-two"),
Contains("branch-one"),
)
diff --git a/pkg/integration/tests/custom_commands/suggestions_preset.go b/pkg/integration/tests/custom_commands/suggestions_preset.go
index 40c888625..d4ae422ad 100644
--- a/pkg/integration/tests/custom_commands/suggestions_preset.go
+++ b/pkg/integration/tests/custom_commands/suggestions_preset.go
@@ -57,8 +57,8 @@ var SuggestionsPreset = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Branches().
Lines(
- Contains("branch-three").IsSelected(),
- Contains("branch-four"),
+ Contains("branch-three"),
+ Contains("branch-four").IsSelected(),
Contains("branch-two"),
Contains("branch-one"),
)
diff --git a/pkg/integration/tests/sync/fetch_when_sorted_by_date.go b/pkg/integration/tests/sync/fetch_when_sorted_by_date.go
index d3230b233..4a7af151a 100644
--- a/pkg/integration/tests/sync/fetch_when_sorted_by_date.go
+++ b/pkg/integration/tests/sync/fetch_when_sorted_by_date.go
@@ -41,14 +41,9 @@ var FetchWhenSortedByDate = NewIntegrationTest(NewIntegrationTestArgs{
NavigateToLine(Contains("master")).
Press(keys.Branches.FetchRemote).
Lines(
- /* EXPECTED:
Contains("* branch1"),
Contains("master").IsSelected(),
Contains("branch2"),
- ACTUAL: */
- Contains("* branch1"),
- Contains("master"),
- Contains("branch2").IsSelected(),
)
},
})