Merge branch 'pt/am-builtin'
[gitweb.git] / submodule.c
index 245ed4dfbb6a3d54adbd41d5de0ea64cf38dc8a3..5e5a46fe2ab765ff5ecec01a9bc46351fe596837 100644 (file)
@@ -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;