summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-11-05 12:18:14 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-11-05 12:18:14 -0800
commitf97aee1f941a08a741c7ce2b0dfb6db7d0cc042e (patch)
tree5cb52ec484c40278ad9adbdb73e20a254bea1b9d
parentMerge branch 'js/misc-fixes' into maint (diff)
parentadd_submodule_odb: initialize alt_odb list earlier (diff)
downloadtgif-f97aee1f941a08a741c7ce2b0dfb6db7d0cc042e.tar.xz
Merge branch 'jk/initialization-fix-to-add-submodule-odb' into maint
We peek objects from submodule's object store by linking it to the list of alternate object databases, but the code to do so forgot to correctly initialize the list. * jk/initialization-fix-to-add-submodule-odb: add_submodule_odb: initialize alt_odb list earlier
-rw-r--r--submodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/submodule.c b/submodule.c
index 5e5a46fe2a..a458100ed2 100644
--- a/submodule.c
+++ b/submodule.c
@@ -129,6 +129,7 @@ static int add_submodule_odb(const char *path)
goto done;
}
/* avoid adding it twice */
+ prepare_alt_odb();
for (alt_odb = alt_odb_list; alt_odb; alt_odb = alt_odb->next)
if (alt_odb->name - alt_odb->base == objects_directory.len &&
!strncmp(alt_odb->base, objects_directory.buf,
@@ -146,7 +147,6 @@ static int add_submodule_odb(const char *path)
/* add possible alternates from the submodule */
read_info_alternates(objects_directory.buf, 0);
- prepare_alt_odb();
done:
strbuf_release(&objects_directory);
return ret;