MCPcopy Index your code
hub / github.com/git/git / check_submodule_name

Function check_submodule_name

submodule-config.c:214–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214int check_submodule_name(const char *name)
215{
216 /* Disallow empty names */
217 if (!*name)
218 return -1;
219
220 /*
221 * Look for '..' as a path component. Check is_xplatform_dir_sep() as
222 * separators rather than is_dir_sep(), because we want the name rules
223 * to be consistent across platforms.
224 */
225 goto in_component; /* always start inside component */
226 while (*name) {
227 char c = *name++;
228 if (is_xplatform_dir_sep(c)) {
229in_component:
230 if (name[0] == '.' && name[1] == '.' &&
231 (!name[2] || is_xplatform_dir_sep(name[2])))
232 return -1;
233 }
234 }
235
236 return 0;
237}
238
239static int submodule_url_is_relative(const char *url)
240{

Callers 3

name_and_item_from_varFunction · 0.85
fsck_gitmodules_fnFunction · 0.85
module_addFunction · 0.85

Calls 1

is_xplatform_dir_sepFunction · 0.85

Tested by

no test coverage detected