]> rtime.felk.cvut.cz Git - git.git/blobdiff - ll-merge.c
rerere: honor conflict-marker-size attribute
[git.git] / ll-merge.c
index d6820714d5d4aef940243b7748c2df794a51f567..0dcaae0dd166205e6d17a523789b4b82e5a01f18 100644 (file)
@@ -380,3 +380,18 @@ int ll_merge(mmbuffer_t *result_buf,
                          ours, our_label, theirs, their_label,
                          virtual_ancestor, marker_size);
 }
+
+int ll_merge_marker_size(const char *path)
+{
+       static struct git_attr_check check;
+       int marker_size = DEFAULT_CONFLICT_MARKER_SIZE;
+
+       if (!check.attr)
+               check.attr = git_attr("conflict-marker-size");
+       if (!git_checkattr(path, 1, &check) && check.value) {
+               marker_size = atoi(check.value);
+               if (marker_size <= 0)
+                       marker_size = DEFAULT_CONFLICT_MARKER_SIZE;
+       }
+       return marker_size;
+}