Commit graph

6 commits

Author SHA1 Message Date
Stefan Haller bc9fafff02 Make the conflict marker size a parameter of our marker matching
Git doesn't always write conflict markers of seven characters: the
conflict-marker-size gitattribute overrides that per file, and it is set
for good reasons — for file types whose regular content tends to contain
marker-looking lines, such as documentation about merging, or test
scripts. We hard-code seven characters everywhere we look for markers,
so none of that works.

Prepare for honoring the attribute by threading the marker size through
everything that recognizes a marker, carried on the file model. Nothing
fills it in yet, so we still use git's default size of seven everywhere,
and matching is unchanged: a marker consists of exactly that many marker
characters, and all but the "=======" one are followed by a space and a
label.
2026-08-08 12:43:42 +02:00
Jesse Duffield fdff2dec79 Remove redundant variable dedeclarations
In go 1.22, loop variables are redeclared with each iteration of the
loop, rather than simple updated on each iteration. This means that we
no longer need to manually redeclare variables when they're closed over
by a function.
2024-05-19 16:38:21 +10:00
Ryooooooga a0e7604f61 Support git config merge.conflictStyle diff3 2021-08-25 22:23:55 +10:00
Jesse Duffield 6d91661d5e prevent closure issue 2021-06-05 13:54:05 +10:00
Cristian Betivu fd38ad8096 More generic merge conflict detection 2021-06-05 13:53:25 +10:00
Harrison Jones e478c254d4 Handle alternate merge conflict format; add tests 2021-05-30 13:50:42 +10:00