@@ -961,7 +961,8 @@ static struct exclude *last_exclude_matching_from_list(const char *pathname,
961961 int pathlen ,
962962 const char * basename ,
963963 int * dtype ,
964- struct exclude_list * el )
964+ struct exclude_list * el ,
965+ struct index_state * istate )
965966{
966967 struct exclude * exc = NULL ; /* undecided */
967968 int i ;
@@ -976,7 +977,7 @@ static struct exclude *last_exclude_matching_from_list(const char *pathname,
976977
977978 if (x -> flags & EXC_FLAG_MUSTBEDIR ) {
978979 if (* dtype == DT_UNKNOWN )
979- * dtype = get_dtype (NULL , & the_index , pathname , pathlen );
980+ * dtype = get_dtype (NULL , istate , pathname , pathlen );
980981 if (* dtype != DT_DIR )
981982 continue ;
982983 }
@@ -1012,13 +1013,14 @@ int is_excluded_from_list(const char *pathname,
10121013 struct exclude_list * el )
10131014{
10141015 struct exclude * exclude ;
1015- exclude = last_exclude_matching_from_list (pathname , pathlen , basename , dtype , el );
1016+ exclude = last_exclude_matching_from_list (pathname , pathlen , basename , dtype , el , & the_index );
10161017 if (exclude )
10171018 return exclude -> flags & EXC_FLAG_NEGATIVE ? 0 : 1 ;
10181019 return -1 ; /* undecided */
10191020}
10201021
10211022static struct exclude * last_exclude_matching_from_lists (struct dir_struct * dir ,
1023+ struct index_state * istate ,
10221024 const char * pathname , int pathlen , const char * basename ,
10231025 int * dtype_p )
10241026{
@@ -1030,7 +1032,7 @@ static struct exclude *last_exclude_matching_from_lists(struct dir_struct *dir,
10301032 for (j = group -> nr - 1 ; j >= 0 ; j -- ) {
10311033 exclude = last_exclude_matching_from_list (
10321034 pathname , pathlen , basename , dtype_p ,
1033- & group -> el [j ]);
1035+ & group -> el [j ], istate );
10341036 if (exclude )
10351037 return exclude ;
10361038 }
@@ -1121,6 +1123,7 @@ static void prep_exclude(struct dir_struct *dir, const char *base, int baselen)
11211123 int dt = DT_DIR ;
11221124 dir -> basebuf .buf [stk -> baselen - 1 ] = 0 ;
11231125 dir -> exclude = last_exclude_matching_from_lists (dir ,
1126+ & the_index ,
11241127 dir -> basebuf .buf , stk -> baselen - 1 ,
11251128 dir -> basebuf .buf + current , & dt );
11261129 dir -> basebuf .buf [stk -> baselen - 1 ] = '/' ;
@@ -1209,7 +1212,7 @@ struct exclude *last_exclude_matching(struct dir_struct *dir,
12091212 if (dir -> exclude )
12101213 return dir -> exclude ;
12111214
1212- return last_exclude_matching_from_lists (dir , pathname , pathlen ,
1215+ return last_exclude_matching_from_lists (dir , & the_index , pathname , pathlen ,
12131216 basename , dtype_p );
12141217}
12151218
0 commit comments