On 10/31/2016 03:38 PM, Brandon Williams wrote:
+ struct strbuf buf = STRBUF_INIT; + char *submodule_url = NULL; + + strbuf_addf(&buf, "submodule.%s.url", module->name); + ret = !git_config_get_string(buf.buf, &submodule_url); + + free(submodule_url); + strbuf_release(&buf); + } + + return ret; +} + +/* + * Determine if a submodule has been checked out at a given 'path' + */ +int is_submodule_checked_out(const char *path) +{ + int ret = 0; + struct strbuf buf = STRBUF_INIT; + + strbuf_addf(&buf, "%s/.git", path); + ret = file_exists(buf.buf); + + strbuf_release(&buf);
In this and the previous function, you can use xstrfmt.