allow do_submodule_path to work even if submodule isn't checked out
[gitweb.git] / submodule.c
index 1b5cdfb7e784d646c15e59afb2fb43587a8ff8e9..6096cf428be72289c193eff82ba318c16c58ccee 100644 (file)
@@ -127,7 +127,9 @@ static int add_submodule_odb(const char *path)
        int ret = 0;
        size_t alloc;
 
-       strbuf_git_path_submodule(&objects_directory, path, "objects/");
+       ret = strbuf_git_path_submodule(&objects_directory, path, "objects/");
+       if (ret)
+               goto done;
        if (!is_directory(objects_directory.buf)) {
                ret = -1;
                goto done;
@@ -348,7 +350,7 @@ void show_submodule_summary(FILE *f, const char *path,
        if (is_null_sha1(two))
                message = "(submodule deleted)";
        else if (add_submodule_odb(path))
-               message = "(not checked out)";
+               message = "(not initialized)";
        else if (is_null_sha1(one))
                message = "(new submodule)";
        else if (!(left = lookup_commit_reference(one)) ||