@@ -190,7 +190,7 @@ int fill_directory(struct dir_struct *dir, const struct pathspec *pathspec)
190190 prefix = prefix_len ? pathspec -> items [0 ].match : "" ;
191191
192192 /* Read the directory and prune it */
193- read_directory (dir , prefix , prefix_len , pathspec );
193+ read_directory (dir , & the_index , prefix , prefix_len , pathspec );
194194
195195 return prefix_len ;
196196}
@@ -2071,8 +2071,8 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d
20712071 return root ;
20722072}
20732073
2074- int read_directory (struct dir_struct * dir , const char * path ,
2075- int len , const struct pathspec * pathspec )
2074+ int read_directory (struct dir_struct * dir , struct index_state * istate ,
2075+ const char * path , int len , const struct pathspec * pathspec )
20762076{
20772077 struct untracked_cache_dir * untracked ;
20782078
@@ -2086,8 +2086,8 @@ int read_directory(struct dir_struct *dir, const char *path,
20862086 * e.g. prep_exclude()
20872087 */
20882088 dir -> untracked = NULL ;
2089- if (!len || treat_leading_path (dir , & the_index , path , len , pathspec ))
2090- read_directory_recursive (dir , & the_index , path , len , untracked , 0 , pathspec );
2089+ if (!len || treat_leading_path (dir , istate , path , len , pathspec ))
2090+ read_directory_recursive (dir , istate , path , len , untracked , 0 , pathspec );
20912091 QSORT (dir -> entries , dir -> nr , cmp_name );
20922092 QSORT (dir -> ignored , dir -> ignored_nr , cmp_name );
20932093 if (dir -> untracked ) {
@@ -2101,12 +2101,12 @@ int read_directory(struct dir_struct *dir, const char *path,
21012101 dir -> untracked -> gitignore_invalidated ,
21022102 dir -> untracked -> dir_invalidated ,
21032103 dir -> untracked -> dir_opened );
2104- if (dir -> untracked == the_index . untracked &&
2104+ if (dir -> untracked == istate -> untracked &&
21052105 (dir -> untracked -> dir_opened ||
21062106 dir -> untracked -> gitignore_invalidated ||
21072107 dir -> untracked -> dir_invalidated ))
2108- the_index . cache_changed |= UNTRACKED_CHANGED ;
2109- if (dir -> untracked != the_index . untracked ) {
2108+ istate -> cache_changed |= UNTRACKED_CHANGED ;
2109+ if (dir -> untracked != istate -> untracked ) {
21102110 free (dir -> untracked );
21112111 dir -> untracked = NULL ;
21122112 }
0 commit comments