@@ -83,7 +83,7 @@ static int process_lstat_error(const char *path, int err)
8383 return error ("lstat(\"%s\"): %s" , path , strerror (errno ));
8484}
8585
86- static int add_one_path (struct cache_entry * old , const char * path , int len , struct stat * st )
86+ static int add_one_path (const struct cache_entry * old , const char * path , int len , struct stat * st )
8787{
8888 int option , size ;
8989 struct cache_entry * ce ;
@@ -142,7 +142,7 @@ static int process_directory(const char *path, int len, struct stat *st)
142142
143143 /* Exact match: file or existing gitlink */
144144 if (pos >= 0 ) {
145- struct cache_entry * ce = active_cache [pos ];
145+ const struct cache_entry * ce = active_cache [pos ];
146146 if (S_ISGITLINK (ce -> ce_mode )) {
147147
148148 /* Do nothing to the index if there is no HEAD! */
@@ -158,7 +158,7 @@ static int process_directory(const char *path, int len, struct stat *st)
158158 /* Inexact match: is there perhaps a subdirectory match? */
159159 pos = - pos - 1 ;
160160 while (pos < active_nr ) {
161- struct cache_entry * ce = active_cache [pos ++ ];
161+ const struct cache_entry * ce = active_cache [pos ++ ];
162162
163163 if (strncmp (ce -> name , path , len ))
164164 break ;
@@ -183,7 +183,7 @@ static int process_path(const char *path)
183183{
184184 int pos , len ;
185185 struct stat st ;
186- struct cache_entry * ce ;
186+ const struct cache_entry * ce ;
187187
188188 len = strlen (path );
189189 if (has_symlink_leading_path (path , len ))
@@ -448,7 +448,7 @@ static int unresolve_one(const char *path)
448448 /* already merged */
449449 pos = unmerge_cache_entry_at (pos );
450450 if (pos < active_nr ) {
451- struct cache_entry * ce = active_cache [pos ];
451+ const struct cache_entry * ce = active_cache [pos ];
452452 if (ce_stage (ce ) &&
453453 ce_namelen (ce ) == namelen &&
454454 !memcmp (ce -> name , path , namelen ))
@@ -462,7 +462,7 @@ static int unresolve_one(const char *path)
462462 */
463463 pos = - pos - 1 ;
464464 if (pos < active_nr ) {
465- struct cache_entry * ce = active_cache [pos ];
465+ const struct cache_entry * ce = active_cache [pos ];
466466 if (ce_namelen (ce ) == namelen &&
467467 !memcmp (ce -> name , path , namelen )) {
468468 fprintf (stderr ,
@@ -558,7 +558,7 @@ static int do_reupdate(int ac, const char **av,
558558 has_head = 0 ;
559559 redo :
560560 for (pos = 0 ; pos < active_nr ; pos ++ ) {
561- struct cache_entry * ce = active_cache [pos ];
561+ const struct cache_entry * ce = active_cache [pos ];
562562 struct cache_entry * old = NULL ;
563563 int save_nr ;
564564
0 commit comments