| 1550 | } |
| 1551 | |
| 1552 | int 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 | |
| 1571 | static int path_in_sparse_checkout_1(const char *path, |
| 1572 | struct index_state *istate, |
no test coverage detected