@@ -220,7 +220,7 @@ static void report_invalid_attr(const char *name, size_t len,
220220 * dictionary. If no entry is found, create a new attribute and store it in
221221 * the dictionary.
222222 */
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 )
224224{
225225 struct git_attr * a ;
226226
@@ -244,14 +244,14 @@ static struct git_attr *git_attr_internal(const char *name, int namelen)
244244 return a ;
245245}
246246
247- struct git_attr * git_attr (const char * name )
247+ const struct git_attr * git_attr (const char * name )
248248{
249249 return git_attr_internal (name , strlen (name ));
250250}
251251
252252/* What does a matched pattern decide? */
253253struct attr_state {
254- struct git_attr * attr ;
254+ const struct git_attr * attr ;
255255 const char * setto ;
256256};
257257
@@ -278,7 +278,7 @@ struct pattern {
278278struct match_attr {
279279 union {
280280 struct pattern pat ;
281- struct git_attr * attr ;
281+ const struct git_attr * attr ;
282282 } u ;
283283 char is_macro ;
284284 unsigned num_attr ;
@@ -898,7 +898,7 @@ static int fill_one(const char *what, struct all_attrs_item *all_attrs,
898898 int i ;
899899
900900 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 ;
902902 const char * * n = & (all_attrs [attr -> attr_nr ].value );
903903 const char * v = a -> state [i ].setto ;
904904
@@ -922,7 +922,7 @@ static int fill(const char *path, int pathlen, int basename_offset,
922922 const char * base = stk -> origin ? stk -> origin : "" ;
923923
924924 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 ];
926926 if (a -> is_macro )
927927 continue ;
928928 if (path_matches (path , pathlen , basename_offset ,
0 commit comments