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
This commit is contained in:
21
repository.c
21
repository.c
@ -190,19 +190,15 @@ error:
|
||||
|
||||
int repo_submodule_init(struct repository *subrepo,
|
||||
struct repository *superproject,
|
||||
const struct submodule *sub)
|
||||
const char *path,
|
||||
const struct object_id *treeish_name)
|
||||
{
|
||||
struct strbuf gitdir = STRBUF_INIT;
|
||||
struct strbuf worktree = STRBUF_INIT;
|
||||
int ret = 0;
|
||||
|
||||
if (!sub) {
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
strbuf_repo_worktree_path(&gitdir, superproject, "%s/.git", sub->path);
|
||||
strbuf_repo_worktree_path(&worktree, superproject, "%s", sub->path);
|
||||
strbuf_repo_worktree_path(&gitdir, superproject, "%s/.git", path);
|
||||
strbuf_repo_worktree_path(&worktree, superproject, "%s", path);
|
||||
|
||||
if (repo_init(subrepo, gitdir.buf, worktree.buf)) {
|
||||
/*
|
||||
@ -212,6 +208,13 @@ int repo_submodule_init(struct repository *subrepo,
|
||||
* 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);
|
||||
submodule_name_to_gitdir(&gitdir, superproject, sub->name);
|
||||
|
||||
@ -224,7 +227,7 @@ int repo_submodule_init(struct repository *subrepo,
|
||||
subrepo->submodule_prefix = xstrfmt("%s%s/",
|
||||
superproject->submodule_prefix ?
|
||||
superproject->submodule_prefix :
|
||||
"", sub->path);
|
||||
"", path);
|
||||
|
||||
out:
|
||||
strbuf_release(&gitdir);
|
||||
|
Reference in New Issue
Block a user