@@ -483,12 +483,13 @@ void prepare_submodule_repo_env(struct argv_array *out)
}
/*
- * Initialize 'out' based on the provided submodule path.
+ * Initialize a repository struct for a submodule based on the provided 'path'.
*
* Unlike repo_submodule_init, this tolerates submodules not present
* in .gitmodules. This function exists only to preserve historical behavior,
*
- * Returns 0 on success, -1 when the submodule is not present.
+ * Returns the repository struct on success,
+ * NULL when the submodule is not present.
*/
static struct repository *open_submodule(const char *path)
{
@@ -501,6 +502,7 @@ static struct repository *open_submodule(const char *path)
return NULL;
}
+ /* Mark it as a submodule */
out->submodule_prefix = xstrdup(path);
strbuf_release(&sb);