MCPcopy Create free account
hub / github.com/git/git / init_sparse_checkout_patterns

Function init_sparse_checkout_patterns

dir.c:1552–1569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1550}
1551
1552int init_sparse_checkout_patterns(struct index_state *istate)
1553{
1554 struct repo_config_values *cfg = repo_config_values(the_repository);
1555
1556 if (!cfg->apply_sparse_checkout)
1557 return 1;
1558 if (istate->sparse_checkout_patterns)
1559 return 0;
1560
1561 CALLOC_ARRAY(istate->sparse_checkout_patterns, 1);
1562
1563 if (get_sparse_checkout_patterns(istate->sparse_checkout_patterns) < 0) {
1564 FREE_AND_NULL(istate->sparse_checkout_patterns);
1565 return -1;
1566 }
1567
1568 return 0;
1569}
1570
1571static int path_in_sparse_checkout_1(const char *path,
1572 struct index_state *istate,

Callers 3

is_sparse_index_allowedFunction · 0.85

Calls 2

repo_config_valuesClass · 0.70

Tested by

no test coverage detected