@@ -353,16 +353,16 @@ void sha1_file_name(struct repository *r, struct strbuf *buf, const unsigned cha
353353 fill_sha1_path (buf , sha1 );
354354}
355355
356- struct strbuf * alt_scratch_buf (struct alternate_object_database * alt )
356+ struct strbuf * alt_scratch_buf (struct object_directory * odb )
357357{
358- strbuf_setlen (& alt -> scratch , alt -> base_len );
359- return & alt -> scratch ;
358+ strbuf_setlen (& odb -> scratch , odb -> base_len );
359+ return & odb -> scratch ;
360360}
361361
362- static const char * alt_sha1_path (struct alternate_object_database * alt ,
362+ static const char * alt_sha1_path (struct object_directory * odb ,
363363 const unsigned char * sha1 )
364364{
365- struct strbuf * buf = alt_scratch_buf (alt );
365+ struct strbuf * buf = alt_scratch_buf (odb );
366366 fill_sha1_path (buf , sha1 );
367367 return buf -> buf ;
368368}
@@ -374,7 +374,7 @@ static int alt_odb_usable(struct raw_object_store *o,
374374 struct strbuf * path ,
375375 const char * normalized_objdir )
376376{
377- struct alternate_object_database * alt ;
377+ struct object_directory * odb ;
378378
379379 /* Detect cases where alternate disappeared */
380380 if (!is_directory (path -> buf )) {
@@ -388,8 +388,8 @@ static int alt_odb_usable(struct raw_object_store *o,
388388 * Prevent the common mistake of listing the same
389389 * thing twice, or object directory itself.
390390 */
391- for (alt = o -> alt_odb_list ; alt ; alt = alt -> next ) {
392- if (!fspathcmp (path -> buf , alt -> path ))
391+ for (odb = o -> alt_odb_list ; odb ; odb = odb -> next ) {
392+ if (!fspathcmp (path -> buf , odb -> path ))
393393 return 0 ;
394394 }
395395 if (!fspathcmp (path -> buf , normalized_objdir ))
@@ -402,7 +402,7 @@ static int alt_odb_usable(struct raw_object_store *o,
402402 * Prepare alternate object database registry.
403403 *
404404 * The variable alt_odb_list points at the list of struct
405- * alternate_object_database . The elements on this list come from
405+ * object_directory . The elements on this list come from
406406 * non-empty elements from colon separated ALTERNATE_DB_ENVIRONMENT
407407 * environment variable, and $GIT_OBJECT_DIRECTORY/info/alternates,
408408 * whose contents is similar to that environment variable but can be
@@ -419,7 +419,7 @@ static void read_info_alternates(struct repository *r,
419419static int link_alt_odb_entry (struct repository * r , const char * entry ,
420420 const char * relative_base , int depth , const char * normalized_objdir )
421421{
422- struct alternate_object_database * ent ;
422+ struct object_directory * ent ;
423423 struct strbuf pathbuf = STRBUF_INIT ;
424424
425425 if (!is_absolute_path (entry ) && relative_base ) {
@@ -540,9 +540,9 @@ static void read_info_alternates(struct repository *r,
540540 free (path );
541541}
542542
543- struct alternate_object_database * alloc_alt_odb (const char * dir )
543+ struct object_directory * alloc_alt_odb (const char * dir )
544544{
545- struct alternate_object_database * ent ;
545+ struct object_directory * ent ;
546546
547547 FLEX_ALLOC_STR (ent , path , dir );
548548 strbuf_init (& ent -> scratch , 0 );
@@ -684,7 +684,7 @@ char *compute_alternate_path(const char *path, struct strbuf *err)
684684
685685int foreach_alt_odb (alt_odb_fn fn , void * cb )
686686{
687- struct alternate_object_database * ent ;
687+ struct object_directory * ent ;
688688 int r = 0 ;
689689
690690 prepare_alt_odb (the_repository );
@@ -743,10 +743,10 @@ static int check_and_freshen_local(const struct object_id *oid, int freshen)
743743
744744static int check_and_freshen_nonlocal (const struct object_id * oid , int freshen )
745745{
746- struct alternate_object_database * alt ;
746+ struct object_directory * odb ;
747747 prepare_alt_odb (the_repository );
748- for (alt = the_repository -> objects -> alt_odb_list ; alt ; alt = alt -> next ) {
749- const char * path = alt_sha1_path (alt , oid -> hash );
748+ for (odb = the_repository -> objects -> alt_odb_list ; odb ; odb = odb -> next ) {
749+ const char * path = alt_sha1_path (odb , oid -> hash );
750750 if (check_and_freshen_file (path , freshen ))
751751 return 1 ;
752752 }
@@ -893,7 +893,7 @@ int git_open_cloexec(const char *name, int flags)
893893static int stat_sha1_file (struct repository * r , const unsigned char * sha1 ,
894894 struct stat * st , const char * * path )
895895{
896- struct alternate_object_database * alt ;
896+ struct object_directory * odb ;
897897 static struct strbuf buf = STRBUF_INIT ;
898898
899899 strbuf_reset (& buf );
@@ -905,8 +905,8 @@ static int stat_sha1_file(struct repository *r, const unsigned char *sha1,
905905
906906 prepare_alt_odb (r );
907907 errno = ENOENT ;
908- for (alt = r -> objects -> alt_odb_list ; alt ; alt = alt -> next ) {
909- * path = alt_sha1_path (alt , sha1 );
908+ for (odb = r -> objects -> alt_odb_list ; odb ; odb = odb -> next ) {
909+ * path = alt_sha1_path (odb , sha1 );
910910 if (!lstat (* path , st ))
911911 return 0 ;
912912 }
@@ -922,7 +922,7 @@ static int open_sha1_file(struct repository *r,
922922 const unsigned char * sha1 , const char * * path )
923923{
924924 int fd ;
925- struct alternate_object_database * alt ;
925+ struct object_directory * odb ;
926926 int most_interesting_errno ;
927927 static struct strbuf buf = STRBUF_INIT ;
928928
@@ -936,8 +936,8 @@ static int open_sha1_file(struct repository *r,
936936 most_interesting_errno = errno ;
937937
938938 prepare_alt_odb (r );
939- for (alt = r -> objects -> alt_odb_list ; alt ; alt = alt -> next ) {
940- * path = alt_sha1_path (alt , sha1 );
939+ for (odb = r -> objects -> alt_odb_list ; odb ; odb = odb -> next ) {
940+ * path = alt_sha1_path (odb , sha1 );
941941 fd = git_open (* path );
942942 if (fd >= 0 )
943943 return fd ;
@@ -2139,14 +2139,14 @@ struct loose_alt_odb_data {
21392139 void * data ;
21402140};
21412141
2142- static int loose_from_alt_odb (struct alternate_object_database * alt ,
2142+ static int loose_from_alt_odb (struct object_directory * odb ,
21432143 void * vdata )
21442144{
21452145 struct loose_alt_odb_data * data = vdata ;
21462146 struct strbuf buf = STRBUF_INIT ;
21472147 int r ;
21482148
2149- strbuf_addstr (& buf , alt -> path );
2149+ strbuf_addstr (& buf , odb -> path );
21502150 r = for_each_loose_file_in_objdir_buf (& buf ,
21512151 data -> cb , NULL , NULL ,
21522152 data -> data );
0 commit comments