@@ -268,9 +268,9 @@ static struct alternate_object_database **alt_odb_tail;
268
268
* SHA1, an extra slash for the first level indirection, and the
269
269
* terminating NUL.
270
270
*/
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 )
272
273
{
273
- const char * objdir = get_object_directory ();
274
274
struct alternate_object_database * ent ;
275
275
struct alternate_object_database * alt ;
276
276
int pfxlen , entlen ;
@@ -321,7 +321,7 @@ static int link_alt_odb_entry(const char *entry, const char *relative_base, int
321
321
return -1 ;
322
322
}
323
323
}
324
- if (!strcmp (ent -> base , objdir )) {
324
+ if (!strcmp_icase (ent -> base , normalized_objdir )) {
325
325
free (ent );
326
326
return -1 ;
327
327
}
@@ -345,13 +345,17 @@ static void link_alt_odb_entries(const char *alt, int len, int sep,
345
345
struct string_list entries = STRING_LIST_INIT_NODUP ;
346
346
char * alt_copy ;
347
347
int i ;
348
+ struct strbuf objdirbuf = STRBUF_INIT ;
348
349
349
350
if (depth > 5 ) {
350
351
error ("%s: ignoring alternate object stores, nesting too deep." ,
351
352
relative_base );
352
353
return ;
353
354
}
354
355
356
+ strbuf_addstr (& objdirbuf , absolute_path (get_object_directory ()));
357
+ normalize_path_copy (objdirbuf .buf , objdirbuf .buf );
358
+
355
359
alt_copy = xmemdupz (alt , len );
356
360
string_list_split_in_place (& entries , alt_copy , sep , -1 );
357
361
for (i = 0 ; i < entries .nr ; i ++ ) {
@@ -362,11 +366,12 @@ static void link_alt_odb_entries(const char *alt, int len, int sep,
362
366
error ("%s: ignoring relative alternate object store %s" ,
363
367
relative_base , entry );
364
368
} else {
365
- link_alt_odb_entry (entry , relative_base , depth );
369
+ link_alt_odb_entry (entry , relative_base , depth , objdirbuf . buf );
366
370
}
367
371
}
368
372
string_list_clear (& entries , 0 );
369
373
free (alt_copy );
374
+ strbuf_release (& objdirbuf );
370
375
}
371
376
372
377
void read_info_alternates (const char * relative_base , int depth )
0 commit comments