From: Michael Montalbo Date: Sun, 02 Aug 2026 00:49:40 GMT Subject: Re: [PATCH 3/4] add: introduce '--resolved' option Message-ID: In-Reply-To: On Wed, Jul 29, 2026 at 8:17 AM Junio C Hamano wrote: > > > Left unchecked, this loop may end up scanning a large binary file to > the end in vain. We may squeeze in something like this to punt > early. > > merge-ll.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/merge-ll.c b/merge-ll.c > index 5e5044b9e3..ef5287dee8 100644 > --- a/merge-ll.c > +++ b/merge-ll.c > @@ -516,6 +516,9 @@ int has_conflict_markers(struct index_state *istate, const char *path) > has_markers = 1; > break; > } > + if (buffer_is_binary(sb.buf, > + ULONG_MAX <= sb.len ? ULONG_MAX : sb.len)) > + break; > } Should this check be before the conflict marker line check in case the first iteration accidentally matches for a binary file and breaks with has_markers = 1?