From ca06a9560658be74b9143a1e45e3320b78432b81 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 14 Nov 2019 11:43:22 +0100 Subject: [PATCH] fixup! built-in add -p: implement the hunk splitting feature A long time ago, Phillip Wood pointed out that this would be easier to read, and I agreed, but failed to backport the fix to Git for Windows' `master` branch. Signed-off-by: Johannes Schindelin --- add-patch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/add-patch.c b/add-patch.c index aeff1e9af6c2a0..92febf8564faf8 100644 --- a/add-patch.c +++ b/add-patch.c @@ -829,7 +829,7 @@ static int split_hunk(struct add_p_state *s, struct file_diff *file_diff, end = hunk->end; colored_end = hunk->colored_end; - memcpy(&remaining, &hunk->header, sizeof(remaining)); + remaining = hunk->header; file_diff->hunk_nr += splittable_into - 1; ALLOC_GROW(file_diff->hunk, file_diff->hunk_nr, file_diff->hunk_alloc);