Skip to content

Commit 0c89fdd

Browse files
stefanbellergitster
authored andcommitted
submodule-config: remove submodule_from_cache
This continues the story of bf12fcd (submodule-config: store the_submodule_cache in the_repository, 2017-06-22). The previous patch taught submodule_from_path to take a repository into account, such that submodule_from_{path, cache} are the same now. Remove submodule_from_cache, migrating all its callers to submodule_from_path. Reviewed-by: Jonathan Tan <[email protected]> Signed-off-by: Stefan Beller <[email protected]> Reviewed-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3b8fb39 commit 0c89fdd

File tree

4 files changed

+3
-15
lines changed

4 files changed

+3
-15
lines changed

repository.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ int repo_submodule_init(struct repository *submodule,
176176
struct strbuf worktree = STRBUF_INIT;
177177
int ret = 0;
178178

179-
sub = submodule_from_cache(superproject, &null_oid, path);
179+
sub = submodule_from_path(superproject, &null_oid, path);
180180
if (!sub) {
181181
ret = -1;
182182
goto out;

submodule-config.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -635,15 +635,6 @@ const struct submodule *submodule_from_path(struct repository *r,
635635
return config_from(r->submodule_cache, treeish_name, path, lookup_path);
636636
}
637637

638-
const struct submodule *submodule_from_cache(struct repository *repo,
639-
const struct object_id *treeish_name,
640-
const char *key)
641-
{
642-
gitmodules_read_check(repo);
643-
return config_from(repo->submodule_cache, treeish_name,
644-
key, lookup_path);
645-
}
646-
647638
void submodule_free(struct repository *r)
648639
{
649640
if (r->submodule_cache)

submodule-config.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ const struct submodule *submodule_from_name(struct repository *r,
4545
const struct submodule *submodule_from_path(struct repository *r,
4646
const struct object_id *commit_or_tree,
4747
const char *path);
48-
extern const struct submodule *submodule_from_cache(struct repository *repo,
49-
const struct object_id *treeish_name,
50-
const char *key);
5148
void submodule_free(struct repository *r);
5249

5350
#endif /* SUBMODULE_CONFIG_H */

submodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ int is_submodule_active(struct repository *repo, const char *path)
231231
const struct string_list *sl;
232232
const struct submodule *module;
233233

234-
module = submodule_from_cache(repo, &null_oid, path);
234+
module = submodule_from_path(repo, &null_oid, path);
235235

236236
/* early return if there isn't a path->module mapping */
237237
if (!module)
@@ -1236,7 +1236,7 @@ static int get_next_submodule(struct child_process *cp,
12361236
if (!S_ISGITLINK(ce->ce_mode))
12371237
continue;
12381238

1239-
submodule = submodule_from_cache(spf->r, &null_oid, ce->name);
1239+
submodule = submodule_from_path(spf->r, &null_oid, ce->name);
12401240
if (!submodule) {
12411241
const char *name = default_name_or_path(ce->name);
12421242
if (name) {

0 commit comments

Comments
 (0)