jesseduffield.lazygit/pkg/integration/tests
Stefan Haller 1fdcc29277 Fix deleting update-ref todos
It is a bad idea to read a git-rebase-todo file, remove some update-ref todos,
and write it back out behind git's back. This will cause git to actually remove
the branches referenced by those update-ref todos when the rebase is continued.

The reason is that git remembers the refs affected by update-ref todos at the
beginning of the rebase, and remembers information about them in the file
.git/rebase-merge/update-refs. Then, whenever the user performs a "git rebase
--edit-todo" command, it updates that file based on whether update-ref todos
were added or removed by that edit. If we rewrite the git-rebase-todo file
behind git's back, this updating doesn't happen.

Fix this by not updating the git-rebase-todo file directly in this case, but
performing a "git rebase --edit-todo" command where we set ourselves as the
editor and change the file in there. This makes git update the bookkeeping
information properly.

Ideally we would use this method for all cases where we change the
git-rebase-todo file (e.g. moving todos up/down, or changing the type of a
todo); this would be cleaner because we wouldn't mess with git's private
implementation details. I tried this, but unfortunately it isn't fast enough.
Right now, moving a todo up or down takes between 1 and 2ms on my machine;
changing it to do a "git rebase --edit-todo" slows it down to over 100ms, which
is unacceptable.
2024-03-26 22:29:56 +01:00
..
bisect Deprecate git.log.showGraph and git.log.order config 2024-02-16 13:23:35 +01:00
branch Use ErrorToast instead of error panel when invoking a disabled command 2024-01-14 17:45:35 +01:00
cherry_pick Deprecate git.log.showGraph and git.log.order config 2024-02-16 13:23:35 +01:00
commit Make it easy to create "amend!" commits 2024-03-22 08:27:45 +01:00
config Support matchers on integers in integration tests 2023-06-03 15:32:23 +10:00
conflicts Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
custom_commands Fix order problems when saving custom commands history 2024-02-16 13:31:37 +01:00
demo Update interactive rebase demo 2024-03-23 20:45:51 +11:00
diff Add busy count for integration tests 2023-07-08 22:54:52 +10:00
file Support range select for staging/discarding files 2024-01-25 11:34:59 +11:00
filter_and_search Default to substring filtering, add option to go back to fuzzy filtering 2024-03-17 11:55:09 +01:00
filter_by_author Add author filtering to commit view 2024-02-21 09:58:09 +01:00
filter_by_path Pass -f as single arg in integration test 2024-01-12 20:19:50 +11:00
interactive_rebase Fix deleting update-ref todos 2024-03-26 22:29:56 +01:00
misc Change CopiedToClipboard text to start lower-case 2024-03-22 09:59:46 +01:00
patch_building Add integration test 2024-02-18 15:24:09 +01:00
reflog Deprecate git.log.showGraph and git.log.order config 2024-02-16 13:23:35 +01:00
shared Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
staging Add range selection ability on list contexts 2024-01-19 10:47:21 +11:00
stash feat: add age on stash lines 2023-12-27 11:21:49 +01:00
submodule Show all submodules recursively 2024-03-07 20:16:28 +01:00
sync Keep same branch selected when refreshing branches 2024-01-19 09:25:07 +01:00
tag Make it possible to handle toasts in integration tests 2024-01-14 17:42:03 +01:00
ui Show mode-specific keybinding suggestions 2024-01-28 08:33:13 +11:00
undo Support range select in rebase actions 2024-01-23 17:23:56 +11:00
worktree Support range select for staging/discarding files 2024-01-25 11:34:59 +11:00
test_list.go Make it easy to create "amend!" commits 2024-03-22 08:27:45 +01:00
test_list_generator.go Make test_list_generator.go print what it's doing 2023-09-29 20:40:15 +02:00
tests.go Set working directory in lazygit test command 2024-01-12 19:59:31 +11:00