lazygit/pkg/commands/patch
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
..
format.go Standardise display of range selection across views 2024-01-19 10:47:21 +11:00
hunk.go refactor patch code 2023-03-19 16:30:39 +11:00
parse.go refactor patch code 2023-03-19 16:30:39 +11:00
patch.go Stop cycling hunks when reaching the end 2023-08-15 11:40:40 +02:00
patch_builder.go Fix custom patch operations on added files 2024-06-23 12:40:31 +02:00
patch_line.go refactor patch code 2023-03-19 16:30:39 +11:00
patch_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
transform.go Fix custom patch operations on added files 2024-06-23 12:40:31 +02:00