diff options
-rw-r--r-- | refs.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -1587,6 +1587,9 @@ struct ref_store *get_submodule_ref_store(const char *submodule) char *to_free = NULL; size_t len; + if (!submodule) + return NULL; + if (submodule) { len = strlen(submodule); while (len && is_dir_sep(submodule[len - 1])) @@ -1595,14 +1598,6 @@ struct ref_store *get_submodule_ref_store(const char *submodule) return NULL; } - if (!submodule || !*submodule) { - /* - * FIXME: This case is ideally not allowed. But that - * can't happen until we clean up all the callers. - */ - return get_main_ref_store(); - } - if (submodule[len]) /* We need to strip off one or more trailing slashes */ submodule = to_free = xmemdupz(submodule, len); |