@@ -336,10 +336,10 @@ static const struct ll_merge_driver *find_ll_merge_driver(const char *merge_attr
336336 return & ll_merge_drv [LL_TEXT_MERGE ];
337337}
338338
339- static void normalize_file (mmfile_t * mm , const char * path )
339+ static void normalize_file (mmfile_t * mm , const char * path , struct index_state * istate )
340340{
341341 struct strbuf strbuf = STRBUF_INIT ;
342- if (renormalize_buffer (& the_index , path , mm -> ptr , mm -> size , & strbuf )) {
342+ if (renormalize_buffer (istate , path , mm -> ptr , mm -> size , & strbuf )) {
343343 free (mm -> ptr );
344344 mm -> size = strbuf .len ;
345345 mm -> ptr = strbuf_detach (& strbuf , NULL );
@@ -351,6 +351,7 @@ int ll_merge(mmbuffer_t *result_buf,
351351 mmfile_t * ancestor , const char * ancestor_label ,
352352 mmfile_t * ours , const char * our_label ,
353353 mmfile_t * theirs , const char * their_label ,
354+ struct index_state * istate ,
354355 const struct ll_merge_options * opts )
355356{
356357 static struct attr_check * check ;
@@ -363,15 +364,15 @@ int ll_merge(mmbuffer_t *result_buf,
363364 opts = & default_opts ;
364365
365366 if (opts -> renormalize ) {
366- normalize_file (ancestor , path );
367- normalize_file (ours , path );
368- normalize_file (theirs , path );
367+ normalize_file (ancestor , path , istate );
368+ normalize_file (ours , path , istate );
369+ normalize_file (theirs , path , istate );
369370 }
370371
371372 if (!check )
372373 check = attr_check_initl ("merge" , "conflict-marker-size" , NULL );
373374
374- if (!git_check_attr (& the_index , path , check )) {
375+ if (!git_check_attr (istate , path , check )) {
375376 ll_driver_name = check -> items [0 ].value ;
376377 if (check -> items [1 ].value ) {
377378 marker_size = atoi (check -> items [1 ].value );
@@ -391,14 +392,14 @@ int ll_merge(mmbuffer_t *result_buf,
391392 opts , marker_size );
392393}
393394
394- int ll_merge_marker_size (const char * path )
395+ int ll_merge_marker_size (struct index_state * istate , const char * path )
395396{
396397 static struct attr_check * check ;
397398 int marker_size = DEFAULT_CONFLICT_MARKER_SIZE ;
398399
399400 if (!check )
400401 check = attr_check_initl ("conflict-marker-size" , NULL );
401- if (!git_check_attr (& the_index , path , check ) && check -> items [0 ].value ) {
402+ if (!git_check_attr (istate , path , check ) && check -> items [0 ].value ) {
402403 marker_size = atoi (check -> items [0 ].value );
403404 if (marker_size <= 0 )
404405 marker_size = DEFAULT_CONFLICT_MARKER_SIZE ;
0 commit comments