lazygit/pkg/integration/tests/patch_building
Stefan Haller 4cd15a36e3 Fix custom patch operations on added files
Several custom patch commands on parts of an added file would fail with the
confusing error message "error: new file XXX depends on old contents". These
were dropping the custom patch from the original commit, moving the patch to a
new commit, moving it to a later commit, or moving it to the index.

We fix this by converting the patch header from an added file to a diff against
an empty file. We do this not just for the purpose of applying the patch, but
also for rendering it and copying it to the clip board. I'm not sure it matters
much in these cases, but it does feel more correct for a filtered patch to be
presented this way.
2024-06-23 12:40:31 +02:00
..
apply.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
apply_in_reverse.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
apply_in_reverse_with_conflict.go Support range select for staging/discarding files 2024-01-25 11:34:59 +11:00
move_range_to_index.go Support selecting file range in patch builder 2024-01-28 12:00:47 +11:00
move_to_earlier_commit.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
move_to_earlier_commit_from_added_file.go Add test for moving a patch from an added file to an earlier commit 2024-06-23 12:40:31 +02:00
move_to_earlier_commit_no_keep_empty.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
move_to_index.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
move_to_index_from_added_file_with_conflict.go Fix custom patch operations on added files 2024-06-23 12:40:31 +02:00
move_to_index_part_of_adjacent_added_lines.go Remove unneccesary test actions 2024-06-23 12:40:31 +02:00
move_to_index_partial.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
move_to_index_with_conflict.go Support range select for staging/discarding files 2024-01-25 11:34:59 +11:00
move_to_index_works_even_if_noprefix_is_set.go Add integration test 2024-02-18 15:24:09 +01:00
move_to_later_commit.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
move_to_later_commit_partial_hunk.go Remove unneccesary test actions 2024-06-23 12:40:31 +02:00
move_to_new_commit.go Prompt for commit message when moving a custom patch to a new commit 2023-07-23 13:55:48 +02:00
move_to_new_commit_from_added_file.go Fix custom patch operations on added files 2024-06-23 12:40:31 +02:00
move_to_new_commit_from_deleted_file.go Add test for moving a patch from a deleted file to a new commit 2024-06-23 12:40:31 +02:00
move_to_new_commit_partial_hunk.go Remove unneccesary test actions 2024-06-23 12:40:31 +02:00
remove_from_commit.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
remove_parts_of_added_file.go Fix custom patch operations on added files 2024-06-23 12:40:31 +02:00
reset_with_escape.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
select_all_files.go Fix typo 2024-01-28 09:49:56 +01:00
specific_selection.go Fix custom patch operations on added files 2024-06-23 12:40:31 +02:00
start_new_patch.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
toggle_range.go Support selecting file range in patch builder 2024-01-28 12:00:47 +11:00