diff options
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/submodule.c b/submodule.c index 245ed4dfbb..5e5a46fe2a 100644 --- a/submodule.c +++ b/submodule.c @@ -122,15 +122,8 @@ static int add_submodule_odb(const char *path) struct strbuf objects_directory = STRBUF_INIT; struct alternate_object_database *alt_odb; int ret = 0; - const char *git_dir; - strbuf_addf(&objects_directory, "%s/.git", path); - git_dir = read_gitfile(objects_directory.buf); - if (git_dir) { - strbuf_reset(&objects_directory); - strbuf_addstr(&objects_directory, git_dir); - } - strbuf_addstr(&objects_directory, "/objects/"); + strbuf_git_path_submodule(&objects_directory, path, "objects/"); if (!is_directory(objects_directory.buf)) { ret = -1; goto done; |