jesseduffield.lazygit/pkg/integration/tests
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
..
bisect Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
branch Fix possible crash when deleting a branch while filtering is active 2025-02-07 09:34:25 +01:00
cherry_pick Add number of commits to cherry-pick confirmation prompt 2025-01-08 21:08:42 -08:00
commit Improve and adapt commit persistence test-cases 2025-02-07 09:28:27 +01:00
config Fix loading customCommands from per-repo config file 2024-08-24 11:01:25 +02:00
conflicts Show current files filter as radio buttons 2025-02-07 09:24:24 +01:00
custom_commands Expose {{.SelectedCommitRange}} to custom commands 2025-01-27 08:53:50 +01:00
demo Add number of commits to cherry-pick confirmation prompt 2025-01-08 21:08:42 -08:00
diff Add a simple integration test for non-sticky range diff 2024-08-28 19:51:15 +02:00
file Collapse/expand all files in tree 2025-01-13 21:13:11 +01:00
filter_and_search Show current files filter as radio buttons 2025-02-07 09:24:24 +01:00
filter_by_author Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
filter_by_path Keep the same commit selected when exiting filtering mode 2024-03-28 12:23:46 +01:00
interactive_rebase Fix moving a commit across a branch boundary in a stack 2024-12-23 12:18:48 +01:00
misc [DATALAD RUNCMD] run codespell throughout fixing typos automagically 2024-08-27 18:03:00 +02:00
patch_building Adjust line number for working copy when editing a line 2025-01-07 17:46:51 +01:00
reflog Add number of commits to cherry-pick confirmation prompt 2025-01-08 21:08:42 -08:00
shared Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
shell_commands Rename "Custom Command" to "Shell Command" 2024-08-17 10:56:03 +02:00
staging add test case for decreasing Diff Context length to zero 2024-11-19 08:21:19 +11:00
stash Fix incorrect stash diff after rename 2025-02-06 09:55:26 +01:00
status Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
submodule Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
sync Fix typos 2025-01-03 10:50:36 +11:00
tag Fix tag truncated when copying to clipboard 2025-02-03 21:25:34 +00:00
ui Fix typos 2025-01-03 10:50:36 +11:00
undo Improve undo action to restore files upon undoing a commit 2025-01-18 00:07:15 +11:00
worktree Fix typos 2025-01-03 10:50:36 +11:00
test_list.go Fix possible crash when deleting a branch while filtering is active 2025-02-07 09:34:25 +01:00
test_list_generator.go Fix typos 2025-01-03 10:50:36 +11:00
tests.go Set working directory in lazygit test command 2024-01-12 19:59:31 +11:00