jesseduffield.lazygit/pkg/integration/tests
Stefan Haller 5321101276 Use 'break' instead of 'edit' for BeginInteractiveRebaseForCommit with merge commit
BeginInteractiveRebaseForCommit is used for all the patch commands, and for
rewording. It works by setting the commit we want to stop at to 'edit'; this
doesn't work for merge commits. This wasn't a problem for the patch commands so
far, because you typically don't use custom patches with merge commits (although
we don't prevent this; maybe we should?).

However, it was a problem when you tried to reword a merge commit; this
previously failed with an error, as the test added in the previous commit
demonstrated.

Also, we want to add a new patch command that has to stop *before* the selected
commit (pull patch to new commit before the original one), and this wouldn't
work for the first commit in a feature branch, because it would have to set the
last commit before that to 'edit', which isn't possible if that's a merge (which
is likely).

To fix all this, use a 'break' before the selected commit if the commit is a
merge. It is important that we only do it in that case and not always, otherwise
we would break the new regression tests that were added a few commits ago.
2025-05-10 18:44:31 +02:00
..
bisect Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
branch Add new command "Move commits to new branch" 2025-04-21 18:12:50 +02:00
cherry_pick Cleanup: remove unnecessary setup steps 2025-05-10 18:15:42 +02:00
commit Add section headers for rebase todos, cherry-picks, reverts, and actual commits 2025-04-20 16:06:15 +02:00
config Add an integration test for a config with a negative refspec 2025-03-11 08:33:41 +01:00
conflicts Mention which command is continued in PromptToContinueRebase 2025-04-20 15:53:17 +02:00
custom_commands Combine customCommand's subprocess, stream, and showOutput fields into a single output enum 2025-05-01 15:46:06 +02:00
demo Add number of commits to cherry-pick confirmation prompt 2025-01-08 21:08:42 -08:00
diff Allow changing diff context size and rename threshold when main view is focused 2025-04-23 08:38:46 +02:00
file Allow changing diff context size and rename threshold when main view is focused 2025-04-23 08:38:46 +02:00
filter_and_search Add a root item ("/") if files at top level have changed 2025-03-21 08:04:58 +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 Add a root item ("/") if files at top level have changed 2025-03-21 08:04:58 +01:00
interactive_rebase Use 'break' instead of 'edit' for BeginInteractiveRebaseForCommit with merge commit 2025-05-10 18:44:31 +02:00
misc Cleanup: simplify and tighten test expectations related to clipboard 2025-02-19 18:50:12 +01:00
patch_building Regression test for moving custom patch to new commit from last commit of a stacked branch 2025-05-10 18:19:35 +02:00
reflog Add a root item ("/") if files at top level have changed 2025-03-21 08:04:58 +01: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 a root item ("/") if files at top level have changed 2025-03-21 08:04:58 +01:00
stash Always render diffs to the main/secondary context pair, even for files 2025-04-21 18:03:18 +02:00
status Migrate deprecated AllBranchesLogCmd to AllBranchesLogCmds 2025-05-06 23:33:17 -04:00
submodule Fix view selection running out of sync with list selection when view isn't focused 2025-04-20 16:06:15 +02:00
sync Add config for auto-forwarding branches after fetching 2025-04-21 18:06:09 +02:00
tag Cleanup: simplify and tighten test expectations related to clipboard 2025-02-19 18:50:12 +01:00
ui Allow clicking in main view to focus it 2025-04-21 18:03:24 +02:00
undo Add a root item ("/") if files at top level have changed 2025-03-21 08:04:58 +01:00
worktree Fix typos 2025-01-03 10:50:36 +11:00
test_list.go Add test for rewording a merge commit 2025-05-10 18:19:35 +02: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