Skip to content

Commit 5a80d1d

Browse files
committed
Merge branch 'jk/info-alternates-fix' into maint
We used to add an empty alternate object database to the system that does not help anything; it has been corrected. * jk/info-alternates-fix: link_alt_odb_entries: make empty input a noop
2 parents 8e3e51a + f28e366 commit 5a80d1d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sha1_file.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,9 @@ static void link_alt_odb_entries(const char *alt, int sep,
404404
struct strbuf objdirbuf = STRBUF_INIT;
405405
struct strbuf entry = STRBUF_INIT;
406406

407+
if (!alt || !*alt)
408+
return;
409+
407410
if (depth > 5) {
408411
error("%s: ignoring alternate object stores, nesting too deep.",
409412
relative_base);
@@ -607,7 +610,6 @@ void prepare_alt_odb(void)
607610
return;
608611

609612
alt = getenv(ALTERNATE_DB_ENVIRONMENT);
610-
if (!alt) alt = "";
611613

612614
alt_odb_tail = &alt_odb_list;
613615
link_alt_odb_entries(alt, PATH_SEP, NULL, 0);

0 commit comments

Comments
 (0)