return &ll_merge_drv[LL_TEXT_MERGE];
}
-static void normalize_file(mmfile_t *mm, const char *path)
+static void normalize_file(mmfile_t *mm, const char *path, struct index_state *istate)
{
struct strbuf strbuf = STRBUF_INIT;
- if (renormalize_buffer(&the_index, path, mm->ptr, mm->size, &strbuf)) {
+ if (renormalize_buffer(istate, path, mm->ptr, mm->size, &strbuf)) {
free(mm->ptr);
mm->size = strbuf.len;
mm->ptr = strbuf_detach(&strbuf, NULL);
mmfile_t *ancestor, const char *ancestor_label,
mmfile_t *ours, const char *our_label,
mmfile_t *theirs, const char *their_label,
+ struct index_state *istate,
const struct ll_merge_options *opts)
{
static struct attr_check *check;
opts = &default_opts;
if (opts->renormalize) {
- normalize_file(ancestor, path);
- normalize_file(ours, path);
- normalize_file(theirs, path);
+ normalize_file(ancestor, path, istate);
+ normalize_file(ours, path, istate);
+ normalize_file(theirs, path, istate);
}
if (!check)
check = attr_check_initl("merge", "conflict-marker-size", NULL);
- git_check_attr(&the_index, path, check);
+ git_check_attr(istate, path, check);
ll_driver_name = check->items[0].value;
if (check->items[1].value) {
marker_size = atoi(check->items[1].value);
opts, marker_size);
}
-int ll_merge_marker_size(const char *path)
+int ll_merge_marker_size(struct index_state *istate, const char *path)
{
static struct attr_check *check;
int marker_size = DEFAULT_CONFLICT_MARKER_SIZE;
if (!check)
check = attr_check_initl("conflict-marker-size", NULL);
- git_check_attr(&the_index, path, check);
+ git_check_attr(istate, path, check);
if (check->items[0].value) {
marker_size = atoi(check->items[0].value);
if (marker_size <= 0)