strbuf_reset(&sb);
strbuf_addf(&sb, "submodule.%s.url", sub->name);
if (git_config_get_string(sb.buf, &url)) {
- url = xstrdup(sub->url);
-
- if (!url)
+ if (!sub->url)
die(_("No url found for submodule path '%s' in .gitmodules"),
displaypath);
+ url = xstrdup(sub->url);
+
/* Possibly a url relative to parent */
if (starts_with_dot_dot_slash(url) ||
starts_with_dot_slash(url)) {
static int is_active(int argc, const char **argv, const char *prefix)
{
if (argc != 2)
- die("submodule--helper is-active takes exactly 1 arguments");
+ die("submodule--helper is-active takes exactly 1 argument");
gitmodules_config();