diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-11-15 06:14:36 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-15 06:14:36 +0300 |
commit | 26a45eac8004bc700f4439970e21514c258f7342 (patch) | |
tree | d39c6abf806d8df1433e644c9ced701707d49a44 /sha1_file.c | |
parent | 4fff9c7f30d7fef04be801bb465a47489570af75 (diff) | |
parent | f28e36686aae9203c0e4375f6d106ddccd129efc (diff) |
Merge branch 'jk/info-alternates-fix'
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
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c index d708981376..8a7c6b7eba 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -404,6 +404,9 @@ static void link_alt_odb_entries(const char *alt, int sep, struct strbuf objdirbuf = STRBUF_INIT; struct strbuf entry = STRBUF_INIT; + if (!alt || !*alt) + return; + if (depth > 5) { error("%s: ignoring alternate object stores, nesting too deep.", relative_base); @@ -604,7 +607,6 @@ void prepare_alt_odb(void) return; alt = getenv(ALTERNATE_DB_ENVIRONMENT); - if (!alt) alt = ""; alt_odb_tail = &alt_odb_list; link_alt_odb_entries(alt, PATH_SEP, NULL, 0); |