@@ -268,9 +268,9 @@ static struct alternate_object_database **alt_odb_tail;
268268 * SHA1, an extra slash for the first level indirection, and the
269269 * terminating NUL.
270270 */
271- static int link_alt_odb_entry (const char * entry , const char * relative_base , int depth )
271+ static int link_alt_odb_entry (const char * entry , const char * relative_base ,
272+ int depth , const char * normalized_objdir )
272273{
273- const char * objdir = get_object_directory ();
274274 struct alternate_object_database * ent ;
275275 struct alternate_object_database * alt ;
276276 int pfxlen , entlen ;
@@ -321,7 +321,7 @@ static int link_alt_odb_entry(const char *entry, const char *relative_base, int
321321 return -1 ;
322322 }
323323 }
324- if (!strcmp (ent -> base , objdir )) {
324+ if (!strcmp_icase (ent -> base , normalized_objdir )) {
325325 free (ent );
326326 return -1 ;
327327 }
@@ -345,13 +345,17 @@ static void link_alt_odb_entries(const char *alt, int len, int sep,
345345 struct string_list entries = STRING_LIST_INIT_NODUP ;
346346 char * alt_copy ;
347347 int i ;
348+ struct strbuf objdirbuf = STRBUF_INIT ;
348349
349350 if (depth > 5 ) {
350351 error ("%s: ignoring alternate object stores, nesting too deep." ,
351352 relative_base );
352353 return ;
353354 }
354355
356+ strbuf_addstr (& objdirbuf , absolute_path (get_object_directory ()));
357+ normalize_path_copy (objdirbuf .buf , objdirbuf .buf );
358+
355359 alt_copy = xmemdupz (alt , len );
356360 string_list_split_in_place (& entries , alt_copy , sep , -1 );
357361 for (i = 0 ; i < entries .nr ; i ++ ) {
@@ -362,11 +366,12 @@ static void link_alt_odb_entries(const char *alt, int len, int sep,
362366 error ("%s: ignoring relative alternate object store %s" ,
363367 relative_base , entry );
364368 } else {
365- link_alt_odb_entry (entry , relative_base , depth );
369+ link_alt_odb_entry (entry , relative_base , depth , objdirbuf . buf );
366370 }
367371 }
368372 string_list_clear (& entries , 0 );
369373 free (alt_copy );
374+ strbuf_release (& objdirbuf );
370375}
371376
372377void read_info_alternates (const char * relative_base , int depth )
0 commit comments