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

Function get_global_magic

pathspec.c:297–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297static int get_global_magic(int element_magic)
298{
299 int global_magic = 0;
300
301 if (get_literal_global())
302 global_magic |= PATHSPEC_LITERAL;
303
304 /* --glob-pathspec is overridden by :(literal) */
305 if (get_glob_global() && !(element_magic & PATHSPEC_LITERAL))
306 global_magic |= PATHSPEC_GLOB;
307
308 if (get_glob_global() && get_noglob_global())
309 die(_("global 'glob' and 'noglob' pathspec settings are incompatible"));
310
311 if (get_icase_global())
312 global_magic |= PATHSPEC_ICASE;
313
314 if ((global_magic & PATHSPEC_LITERAL) &&
315 (global_magic & ~PATHSPEC_LITERAL))
316 die(_("global 'literal' pathspec setting is incompatible "
317 "with all other global pathspec settings"));
318
319 /* --noglob-pathspec adds :(literal) _unless_ :(glob) is specified */
320 if (get_noglob_global() && !(element_magic & PATHSPEC_GLOB))
321 global_magic |= PATHSPEC_LITERAL;
322
323 return global_magic;
324}
325
326/*
327 * Parse the pathspec element looking for long magic

Callers 1

init_pathspec_itemFunction · 0.85

Calls 5

get_literal_globalFunction · 0.85
get_glob_globalFunction · 0.85
get_noglob_globalFunction · 0.85
get_icase_globalFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected