@matheusbsbs / matheus-bagliano / commits / 00906d6f22
Fork 0

checkout: support renormalization with checkout -m <paths>

Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Aug 3, 2020 at 18:41 UTC 00906d6f227b259ac7c8cebd07bbea0ba4792185
1 file changed +6 -5
builtin/checkout.c
+6 -5
@@ -239,6 +239,8 @@ static int checkout_merged(int pos, const struct checkout *state, int *nr_checko
239 mmbuffer_t result_buf;
240 struct object_id threeway[3];
241 unsigned mode = 0;
242 + struct ll_merge_options ll_opts;
243 + int renormalize = 0;
244
245 memset(threeway, 0, sizeof(threeway));
246 while (pos < active_nr) {
@@ -259,13 +261,12 @@ static int checkout_merged(int pos, const struct checkout *state, int *nr_checko
261 read_mmblob(&ours, &threeway[1]);
262 read_mmblob(&theirs, &threeway[2]);
263
262 - /*
263 - * NEEDSWORK: re-create conflicts from merges with
264 - * merge.renormalize set, too
265 - */
264 + memset(&ll_opts, 0, sizeof(ll_opts));
265 + git_config_get_bool("merge.renormalize", &renormalize);
266 + ll_opts.renormalize = renormalize;
267 status = ll_merge(&result_buf, path, &ancestor, "base",
268 &ours, "ours", &theirs, "theirs",
268 - state->istate, NULL);
269 + state->istate, &ll_opts);
270 free(ancestor.ptr);
271 free(ours.ptr);
272 free(theirs.ptr);