builtin-rerere: more carefully find conflict markers
commit99d698f1e703754422f1dd780487ddbff3726dc3
authorOlivier Marin <dkr@freesurf.fr>
Mon, 7 Jul 2008 12:42:48 +0000 (7 14:42 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 10 Jul 2008 07:17:46 +0000 (10 00:17 -0700)
tree1524e03e8e58318658e8fdf47c31c667d5bd29c6
parenta9a3e82e6d0018ff42ec11fd9560c1ff47add824
builtin-rerere: more carefully find conflict markers

When a conflicting file contains a line that begin with "=======", rerere
failed to parse conflict markers. This result to a wrong preimage file and
an unexpected error for the user.  The boundary between ours and theirs
not just begin with 7 equals, but is followed by either a SP or a LF.

This patch enforces parsing rules so that markers match in the right order,
and when ambiguous, the command does not autoresolve the conflicted file.

Especially because we are introducing rerere.autoupdate configuration
(which is off by default for safety) that automatically stages the
resolution made by rerere, it is necessary to make sure that we do not
autoresolve when there is any ambiguity.

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-rerere.c
t/t4200-rerere.sh