File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed
Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -375,7 +375,7 @@ def normalize_conflict(
375375 line = next (lines , None )
376376 if line is None :
377377 raise ConflictParseFailed ("unexpected eof" )
378- if line .startswith (b"<<<<<<<" ):
378+ if line .startswith (b"<<<<<<< " ):
379379 # parse recursive conflicts, including their processed output in the current hunk
380380 conflict = normalize_conflict (lines , None )
381381 if cur_hunk is not None :
@@ -393,7 +393,7 @@ def normalize_conflict(
393393 raise ConflictParseFailed ("unexpected ======= conflict marker" )
394394 other_hunk = cur_hunk
395395 cur_hunk = b""
396- elif line .startswith (b">>>>>>>" ):
396+ elif line .startswith (b">>>>>>> " ):
397397 # end of conflict. update hasher, and return a normalized conflict
398398 if cur_hunk is None or other_hunk is None :
399399 raise ConflictParseFailed ("unexpected >>>>>>> conflict marker" )
@@ -426,7 +426,7 @@ def normalize_conflicted_file(body: bytes) -> Tuple[bytes, str]:
426426 line = next (lines , None )
427427 if line is None :
428428 return (normalized , hasher .hexdigest ())
429- if line .startswith (b"<<<<<<<" ):
429+ if line .startswith (b"<<<<<<< " ):
430430 normalized += normalize_conflict (lines , hasher )
431431 else :
432432 normalized += line
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ def test_normalize_conflicted_file():
235235 c
236236 ==========
237237 d
238- >>>>>>>>>> longer conflict marker, to be trimmed
238+ >>>>>>>>>> longer conflict marker, to be ignored
239239 """
240240 )
241241 ) == (
@@ -249,14 +249,14 @@ def test_normalize_conflicted_file():
249249
250250 unrelated line
251251
252- <<<<<<<
252+ <<<<<<<<<< HEAD
253253 c
254- =======
254+ ==========
255255 d
256- >>>>>>>
256+ >>>>>>>>>> longer conflict marker, to be ignored
257257 """
258258 ),
259- "3d7cdc2948951408412cc64f3816558407f77e18 " ,
259+ "0630df854874fc5ffb92a197732cce0d8928e898 " ,
260260 )
261261
262262 # Discard original-text-marker from merge.conflictStyle diff3.
@@ -314,18 +314,18 @@ def test_normalize_conflicted_file():
314314 normalize_conflicted_file (
315315 dedent (
316316 """\
317- <<<<<<<
317+ <<<<<<< ours (outer)
318318 outer left
319- <<<<<<<<<<<
319+ <<<<<<< ours (inner)
320320 inner left
321- |||||||||||
321+ |||||||
322322 inner diff3 original section
323- ===========
323+ =======
324324 inner right
325- >>>>>>>>>>>
325+ >>>>>>> theirs (inner)
326326 =======
327327 outer right
328- >>>>>>>
328+ >>>>>>> theirs (outer)
329329 """
330330 )
331331 )[0 ]
You can’t perform that action at this time.
0 commit comments