From: Junio C Hamano Date: Wed, 6 Oct 2021 20:40:10 +0000 (-0700) Subject: Merge branch 'jt/add-submodule-odb-clean-up' X-Git-Tag: v2.34.0-rc0~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=921c795c25577e40df1f607a22748332bfb225ea;p=thirdparty%2Fgit.git Merge branch 'jt/add-submodule-odb-clean-up' More code paths that use the hack to add submodule's object database to the set of alternate object store have been cleaned up. * jt/add-submodule-odb-clean-up: revision: remove "submodule" from opt struct repository: support unabsorbed in repo_submodule_init submodule: remove unnecessary unabsorbed fallback --- 921c795c25577e40df1f607a22748332bfb225ea diff --cc repository.c index 710a3b4bf8,e4a1afb0ac..c5b90ba93e --- a/repository.c +++ b/repository.c @@@ -212,8 -208,16 +208,15 @@@ int repo_submodule_init(struct reposito * in the superproject's 'modules' directory. In this case the * submodule would not have a worktree. */ + const struct submodule *sub = + submodule_from_path(superproject, treeish_name, path); + if (!sub) { + ret = -1; + goto out; + } + strbuf_reset(&gitdir); - strbuf_repo_git_path(&gitdir, superproject, - "modules/%s", sub->name); + submodule_name_to_gitdir(&gitdir, superproject, sub->name); if (repo_init(subrepo, gitdir.buf, NULL)) { ret = -1;