summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-11-21 14:05:31 +0900
committerJunio C Hamano <gitster@pobox.com>2017-11-21 14:05:31 +0900
commit5a80d1dd9c63dcc7d1a086797e9e8eb99cddffe0 (patch)
tree7a016a3f01167b24fcc89ac2ee733362df1b7a9c
parent8e3e51a3a791074110ab1946d8da3430c65d435c (diff)
parentf28e36686aae9203c0e4375f6d106ddccd129efc (diff)
downloadgit-5a80d1dd9c63dcc7d1a086797e9e8eb99cddffe0.tar.gz
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
-rw-r--r--sha1_file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 10c3a0083d..36f85455e6 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);
@@ -607,7 +610,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);