diff options
-rw-r--r-- | builtin/grep.c | 2 | ||||
-rw-r--r-- | submodule.c | 5 | ||||
-rw-r--r-- | submodule.h | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/builtin/grep.c b/builtin/grep.c index 7d2f8e5adb..87bcb934a2 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -450,7 +450,7 @@ static int grep_submodule(struct grep_opt *opt, * store is no longer global and instead is a member of the repository * object. */ - add_to_alternates_memory(subrepo.objects->odb->path); + add_submodule_odb_by_path(subrepo.objects->odb->path); obj_read_unlock(); memcpy(&subopt, opt, sizeof(subopt)); diff --git a/submodule.c b/submodule.c index 8fde90e906..8de1aecaeb 100644 --- a/submodule.c +++ b/submodule.c @@ -187,6 +187,11 @@ done: return ret; } +void add_submodule_odb_by_path(const char *path) +{ + string_list_insert(&added_submodule_odb_paths, xstrdup(path)); +} + int register_all_submodule_odb_as_alternates(void) { int i; diff --git a/submodule.h b/submodule.h index c252784bc2..17a06cc43b 100644 --- a/submodule.h +++ b/submodule.h @@ -104,6 +104,7 @@ int bad_to_remove_submodule(const char *path, unsigned flags); * the_repository. */ int add_submodule_odb(const char *path); +void add_submodule_odb_by_path(const char *path); int register_all_submodule_odb_as_alternates(void); /* |