diff options
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, |