char *to_free = NULL;
size_t len;
+ if (!submodule)
+ return NULL;
+
if (submodule) {
len = strlen(submodule);
while (len && is_dir_sep(submodule[len - 1]))
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);