@@ -1236,18 +1236,22 @@ static struct dir_entry *dir_entry_new(const char *pathname, int len)
12361236 return ent ;
12371237}
12381238
1239- static struct dir_entry * dir_add_name (struct dir_struct * dir , const char * pathname , int len )
1239+ static struct dir_entry * dir_add_name (struct dir_struct * dir ,
1240+ struct index_state * istate ,
1241+ const char * pathname , int len )
12401242{
1241- if (index_file_exists (& the_index , pathname , len , ignore_case ))
1243+ if (index_file_exists (istate , pathname , len , ignore_case ))
12421244 return NULL ;
12431245
12441246 ALLOC_GROW (dir -> entries , dir -> nr + 1 , dir -> alloc );
12451247 return dir -> entries [dir -> nr ++ ] = dir_entry_new (pathname , len );
12461248}
12471249
1248- struct dir_entry * dir_add_ignored (struct dir_struct * dir , const char * pathname , int len )
1250+ struct dir_entry * dir_add_ignored (struct dir_struct * dir ,
1251+ struct index_state * istate ,
1252+ const char * pathname , int len )
12491253{
1250- if (!index_name_is_other (& the_index , pathname , len ))
1254+ if (!index_name_is_other (istate , pathname , len ))
12511255 return NULL ;
12521256
12531257 ALLOC_GROW (dir -> ignored , dir -> ignored_nr + 1 , dir -> ignored_alloc );
@@ -1819,18 +1823,18 @@ static enum path_treatment read_directory_recursive(struct dir_struct *dir,
18191823 switch (state ) {
18201824 case path_excluded :
18211825 if (dir -> flags & DIR_SHOW_IGNORED )
1822- dir_add_name (dir , path .buf , path .len );
1826+ dir_add_name (dir , & the_index , path .buf , path .len );
18231827 else if ((dir -> flags & DIR_SHOW_IGNORED_TOO ) ||
18241828 ((dir -> flags & DIR_COLLECT_IGNORED ) &&
18251829 exclude_matches_pathspec (path .buf , path .len ,
18261830 pathspec )))
1827- dir_add_ignored (dir , path .buf , path .len );
1831+ dir_add_ignored (dir , & the_index , path .buf , path .len );
18281832 break ;
18291833
18301834 case path_untracked :
18311835 if (dir -> flags & DIR_SHOW_IGNORED )
18321836 break ;
1833- dir_add_name (dir , path .buf , path .len );
1837+ dir_add_name (dir , & the_index , path .buf , path .len );
18341838 if (cdir .fdir )
18351839 add_untracked (untracked , path .buf + baselen );
18361840 break ;
0 commit comments