Files
git/builtin
Phillip Wood d5f4e42f02 merge: remember conflict labels
When recreating merge conflicts with "git checkout -m <path>" the
original conflict labels are lost. For commands like "git merge" and
"git cherry-pick" we could use the presence of the related root
ref (MERGE_HEAD and CHERRY_PICK_HEAD respectively) to recreate the
labels. However, if the conflicts are from "git stash pop" or "git
checkout -m <branch>", then there is no ref to deduce the labels from. To
ensure the labels are always available, the merge machinery is updated to
write ".git/MERGE_LABELS" when it updates the worktree and
there are conflicts. The labels are then read from that file by "git
checkout -m <path>" when recreating the conflicts.

As "git checkout -m <branch>" calls remove_branch_state() which
ordinarily removes the labels file, we need to pass a flag down
to optionally prevent that so that the labels are available for any
subsequent "git checkout -m <path>". Note that merge_switch_to_result()
we assign "result->priv" to "opt->priv" and later clear "opt->priv" in
order to get a pointer to the private struct as result->priv is void*.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-13 10:31:06 -07:00
..
2026-09-07 09:32:06 -07:00
2026-04-10 07:58:53 -07:00
…
2026-10-13 10:31:06 -07:00
2025-09-29 11:40:35 -07:00
…
2026-10-13 10:31:06 -07:00
2025-08-22 13:13:20 -07:00
2026-09-15 11:07:37 -07:00
2026-07-07 10:49:41 -07:00
2026-07-13 08:27:27 -07:00
2026-07-30 10:32:03 -07:00
2026-03-31 20:43:14 -07:00
2026-07-07 10:49:40 -07:00
…
2026-07-07 10:49:40 -07:00
2026-07-07 17:48:57 -07:00
2026-03-31 20:43:14 -07:00
2026-05-06 09:48:28 +09:00
2025-08-21 13:46:59 -07:00