@@ -220,7 +220,7 @@ static void report_invalid_attr(const char *name, size_t len,
220
220
* dictionary. If no entry is found, create a new attribute and store it in
221
221
* the dictionary.
222
222
*/
223
- static struct git_attr * git_attr_internal (const char * name , int namelen )
223
+ static const struct git_attr * git_attr_internal (const char * name , int namelen )
224
224
{
225
225
struct git_attr * a ;
226
226
@@ -244,14 +244,14 @@ static struct git_attr *git_attr_internal(const char *name, int namelen)
244
244
return a ;
245
245
}
246
246
247
- struct git_attr * git_attr (const char * name )
247
+ const struct git_attr * git_attr (const char * name )
248
248
{
249
249
return git_attr_internal (name , strlen (name ));
250
250
}
251
251
252
252
/* What does a matched pattern decide? */
253
253
struct attr_state {
254
- struct git_attr * attr ;
254
+ const struct git_attr * attr ;
255
255
const char * setto ;
256
256
};
257
257
@@ -278,7 +278,7 @@ struct pattern {
278
278
struct match_attr {
279
279
union {
280
280
struct pattern pat ;
281
- struct git_attr * attr ;
281
+ const struct git_attr * attr ;
282
282
} u ;
283
283
char is_macro ;
284
284
unsigned num_attr ;
@@ -898,7 +898,7 @@ static int fill_one(const char *what, struct all_attrs_item *all_attrs,
898
898
int i ;
899
899
900
900
for (i = a -> num_attr - 1 ; rem > 0 && i >= 0 ; i -- ) {
901
- struct git_attr * attr = a -> state [i ].attr ;
901
+ const struct git_attr * attr = a -> state [i ].attr ;
902
902
const char * * n = & (all_attrs [attr -> attr_nr ].value );
903
903
const char * v = a -> state [i ].setto ;
904
904
@@ -922,7 +922,7 @@ static int fill(const char *path, int pathlen, int basename_offset,
922
922
const char * base = stk -> origin ? stk -> origin : "" ;
923
923
924
924
for (i = stk -> num_matches - 1 ; 0 < rem && 0 <= i ; i -- ) {
925
- struct match_attr * a = stk -> attrs [i ];
925
+ const struct match_attr * a = stk -> attrs [i ];
926
926
if (a -> is_macro )
927
927
continue ;
928
928
if (path_matches (path , pathlen , basename_offset ,
0 commit comments