lazygit/pkg/commands/git_commands
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
..
bisect.go rename sha to hash 9, case: Sha 2024-04-12 08:33:47 +02:00
bisect_info.go rename sha to hash 2 2024-04-12 08:33:47 +02:00
blame.go Add command to find base commit for creating a fixup 2024-01-10 09:11:40 +01:00
branch.go rename sha to hash 5 2024-04-12 08:33:47 +02:00
branch_loader.go Show divergence from base branch in branches list 2024-06-03 13:59:43 +02:00
branch_loader_test.go Add ahead/behind information for @{push} 2024-05-19 09:44:38 +02:00
branch_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
commit.go rename sha to hash 5 2024-04-12 08:33:47 +02:00
commit_file_loader.go Set diff.noprefix=false for all other diff commands too 2024-02-18 15:22:43 +01:00
commit_file_loader_test.go
commit_loader.go Show "exec" todos in the list of rebase todos 2024-06-12 12:44:33 +02:00
commit_loader_test.go Factor out CommitLoader.mainBranches into its own class, and store it in Model 2024-06-03 13:02:46 +02:00
commit_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
common.go Remove sync mutex 2023-10-08 18:45:36 +02:00
config.go Add UserConfig jsonschema generation script 2023-12-02 10:46:24 +01:00
custom.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
deps_test.go Add AppState to common.Common 2023-09-04 17:48:39 +02:00
diff.go Support external diff command in diffing mode 2024-04-25 08:50:30 +02:00
file.go Support editing multiple files at once using range selection 2024-03-22 08:20:16 +01:00
file_loader.go Write unit tests with the help of afero 2023-07-30 18:35:36 +10:00
file_loader_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
file_test.go Support editing multiple files at once using range selection 2024-03-22 08:20:16 +01:00
flow.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
flow_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
git_command_builder.go Show all submodules recursively 2024-03-07 20:16:28 +01:00
git_command_builder_test.go Add worktree tests for removing/detaching 2023-07-30 18:35:23 +10:00
main_branches.go Make GetMergeBase a method of ExistingMainBranches 2024-06-03 13:02:46 +02:00
patch.go Fix custom patch operations on added files 2024-06-23 12:40:31 +02:00
rebase.go feat: support range selection for commit attributes amend 2024-06-07 23:09:52 +02:00
rebase_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
reflog_commit_loader.go rename sha to hash 8, update some log and comment 2024-04-12 08:33:47 +02:00
reflog_commit_loader_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
remote.go Obtain remote URL by calling "ls-remote --get-url" instead of using git config 2024-01-10 09:24:23 +01:00
remote_loader.go Implement a sort order menu for remote branches 2023-12-22 16:30:20 +09:00
repo_paths.go Refactor repo_paths.go to use git rev-parse 2024-01-24 08:40:01 +01:00
repo_paths_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
stash.go Fix stashing partialy staged files for git version >= 2.35.0 2024-05-18 09:59:00 +02:00
stash_loader.go chore: use null char as a stash entries divider during loading 2023-12-27 11:21:49 +01:00
stash_loader_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
stash_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
status.go Add StatusCommands.IsInNormalRebase and IsInInteractiveRebase 2023-09-18 10:50:19 +02:00
submodule.go Show all submodules recursively 2024-03-07 20:16:28 +01:00
sync.go Add HEAD: when referencing upstream branch 2024-06-02 09:02:33 +02:00
sync_test.go Add HEAD: when referencing upstream branch 2024-06-02 09:02:33 +02:00
tag.go Remove sync mutex 2023-10-08 18:45:36 +02:00
tag_loader.go Standardise on using lo for slice functions 2023-07-30 18:51:23 +10:00
tag_loader_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
version.go Add a method GitVersion.IsAtLeast 2024-01-10 09:18:38 +01:00
version_test.go Add a method GitVersion.IsAtLeast 2024-01-10 09:18:38 +01:00
working_tree.go chore: fix some comments and typos 2024-04-28 09:44:59 +02:00
working_tree_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
worktree.go Centralise logic for obtaining repo paths 2023-07-30 18:35:24 +10:00
worktree_loader.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
worktree_loader_test.go Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00