jesseduffield.lazygit/pkg/integration/tests/branch
Stefan Haller ff4ae4a544 Fix possible crash when deleting a branch while filtering is active
The code that tries to reselect the same branch again uses GetItems, which in
case of filtering is the filtered list. After replacing the branches slice with
a new one, the filtered list is no longer up to date, so we must reapply the
filter before working with it. It so happens that refreshView does that, so
simply call that before setting the selection again; I don't think the order
matters in this case. Otherwise we'd have to insert another call to
ReApplyFilter before the call to GetItems, which we can avoid this way.

Note that this doesn't actually make anything work better in the case of
deleting a branch, since we can't reselect the deleted branch anyway of course.
But it avoids a possible crash if the branch that was deleted was the last one
in the unfiltered list.
2025-02-07 09:34:25 +01:00
..
checkout_autostash.go Add integration tests for checkout/new branch with autostash 2024-09-03 09:05:53 +02:00
checkout_by_name.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
create_tag.go Better tag creation UX 2023-07-22 14:36:35 +10:00
delete.go Extract test helper function checkRemoteBranches 2024-12-01 10:59:54 +01:00
delete_multiple.go Allow deleting a range selection of branches 2024-12-01 10:59:54 +01:00
delete_remote_branch_with_credential_prompt.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00
delete_remote_branch_with_different_name.go Fix bug with deleting remote branch whose name doesn't match local branch 2024-09-28 11:19:32 +02:00
delete_while_filtering.go Fix possible crash when deleting a branch while filtering is active 2025-02-07 09:34:25 +01:00
detached_head.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
new_branch_autostash.go Add integration tests for checkout/new branch with autostash 2024-09-03 09:05:53 +02:00
new_branch_from_remote_tracking_different_name.go Update tracking behaviour for branches created from remote branches 2024-07-04 22:34:36 +02:00
new_branch_from_remote_tracking_same_name.go Update tracking behaviour for branches created from remote branches 2024-07-04 22:34:36 +02:00
open_pull_request_invalid_target_remote_name.go pkg/gui: Allow user to select remote and branch when creating a PR 2024-11-23 11:52:21 +11:00
open_pull_request_no_upstream.go Use UpstreamBranch for opening pull requests 2023-09-18 13:40:52 +10:00
open_pull_request_select_remote_and_target_branch.go pkg/gui: Allow user to select remote and branch when creating a PR 2024-11-23 11:52:21 +11:00
open_with_cli_arg.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
rebase.go Remove target branch from title of rebase menu 2024-06-03 14:06:11 +02:00
rebase_abort_on_conflict.go Remove target branch from title of rebase menu 2024-06-03 14:06:11 +02:00
rebase_and_drop.go [DATALAD RUNCMD] Do interactive fixing of some ambigous typos 2024-08-27 18:03:00 +02:00
rebase_cancel_on_conflict.go Remove target branch from title of rebase menu 2024-06-03 14:06:11 +02:00
rebase_conflicts_fix_build_errors.go Ask to auto-stage unstaged files when continuing a rebase after resolving conflicts 2024-09-02 18:24:36 +02:00
rebase_copied_branch.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
rebase_does_not_autosquash.go Remove target branch from title of rebase menu 2024-06-03 14:06:11 +02:00
rebase_from_marked_base.go Remove target branch from title of rebase menu 2024-06-03 14:06:11 +02:00
rebase_onto_base_branch.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
rebase_to_upstream.go Fix resetting or rebasing a branch to its upstream when the upstream branch name is different 2025-01-04 15:48:26 +01:00
rename.go Replace whitespace with '-' when renaming a branch 2023-09-05 14:57:18 +01:00
reset.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
reset_to_upstream.go Fix resetting or rebasing a branch to its upstream when the upstream branch name is different 2025-01-04 15:48:26 +01:00
set_upstream.go chore: rename "Set/Unset upstream" menu to "Upstream Options" 2023-09-06 00:23:35 +02:00
shared.go Extract test helper function checkRemoteBranches 2024-12-01 10:59:54 +01:00
show_divergence_from_base_branch.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
show_divergence_from_upstream.go chore: rename "Set/Unset upstream" menu to "Upstream Options" 2023-09-06 00:23:35 +02:00
show_divergence_from_upstream_no_divergence.go Fix crash when viewing the divergence of a branch which is up to date with its upstream 2024-09-18 09:24:10 +02:00
sort_local_branches.go Show radio buttons in the sort order menu for branches 2024-06-23 12:53:15 +02:00
sort_remote_branches.go Show radio buttons in the sort order menu for branches 2024-06-23 12:53:15 +02:00
squash_merge.go feat: squash merge 2024-06-30 11:01:03 +10:00
suggestions.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
unset_upstream.go Fix unsetting upstream when it doesn't exist 2023-11-04 23:46:27 +01:00