diff options
| author | Junio C Hamano <gitster@pobox.com> | 2020-11-02 13:17:43 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-11-02 13:17:43 -0800 |
| commit | c23cd78e8127a2f80cc0357994209bc1bb81a4fe (patch) | |
| tree | b8f06e459c5ede03d54de4fb27eecb53585799b0 /apply.c | |
| parent | Merge branch 'sc/sequencer-gpg-octopus' (diff) | |
| parent | apply: when -R, also reverse list of sections (diff) | |
| download | git-c23cd78e8127a2f80cc0357994209bc1bb81a4fe.tar.gz git-c23cd78e8127a2f80cc0357994209bc1bb81a4fe.zip | |
Merge branch 'jt/apply-reverse-twice'
"git apply -R" did not handle patches that touch the same path
twice correctly, which has been corrected. This is most relevant
in a patch that changes a path from a regular file to a symbolic
link (and vice versa).
* jt/apply-reverse-twice:
apply: when -R, also reverse list of sections
Diffstat (limited to 'apply.c')
| -rw-r--r-- | apply.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -4699,8 +4699,13 @@ static int apply_patch(struct apply_state *state, reverse_patches(patch); if (use_patch(state, patch)) { patch_stats(state, patch); - *listp = patch; - listp = &patch->next; + if (!list || !state->apply_in_reverse) { + *listp = patch; + listp = &patch->next; + } else { + patch->next = list; + list = patch; + } if ((patch->new_name && ends_with_path_components(patch->new_name, |
