From 3f2927c3135a53214abbb058786ad892ebd05fa5 Mon Sep 17 00:00:00 2001 From: Robert Estelle Date: Tue, 14 Sep 2021 15:41:07 -0700 Subject: [PATCH] merge: Dummy determination of conflict marker size --- gitrevise/merge.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gitrevise/merge.py b/gitrevise/merge.py index 131ed19..fb820a4 100644 --- a/gitrevise/merge.py +++ b/gitrevise/merge.py @@ -30,6 +30,12 @@ DEFAULT_CONFLICT_MARKER_SIZE = 7 +def get_conflict_marker_size(__repo: Repository, __file: Path) -> int: + # TODO: Determine on a per-file basis by its `conflict-marker-size` attribute. + # See ll_merge_marker_size in git/ll-merge.c + return DEFAULT_CONFLICT_MARKER_SIZE + + class MergeConflict(Exception): pass @@ -207,7 +213,7 @@ def merge_blobs( tmpdir = repo.get_tempdir() - marker_size = DEFAULT_CONFLICT_MARKER_SIZE + marker_size = get_conflict_marker_size(repo, path) annotated_labels = ( f"{path} (new parent): {labels[0]}",