* Set/Clear CE_NEW_SKIP_WORKTREE according to $GIT_DIR/info/sparse-checkout */
| 1797 | * Set/Clear CE_NEW_SKIP_WORKTREE according to $GIT_DIR/info/sparse-checkout |
| 1798 | */ |
| 1799 | static void mark_new_skip_worktree(struct pattern_list *pl, |
| 1800 | struct index_state *istate, |
| 1801 | int select_flag, int skip_wt_flag, |
| 1802 | int show_progress) |
| 1803 | { |
| 1804 | int i; |
| 1805 | |
| 1806 | /* |
| 1807 | * 1. Pretend the narrowest worktree: only unmerged entries |
| 1808 | * are checked out |
| 1809 | */ |
| 1810 | for (i = 0; i < istate->cache_nr; i++) { |
| 1811 | struct cache_entry *ce = istate->cache[i]; |
| 1812 | |
| 1813 | if (select_flag && !(ce->ce_flags & select_flag)) |
| 1814 | continue; |
| 1815 | |
| 1816 | if (!ce_stage(ce) && !(ce->ce_flags & CE_CONFLICTED)) |
| 1817 | ce->ce_flags |= skip_wt_flag; |
| 1818 | else |
| 1819 | ce->ce_flags &= ~skip_wt_flag; |
| 1820 | } |
| 1821 | |
| 1822 | /* |
| 1823 | * 2. Widen worktree according to sparse-checkout file. |
| 1824 | * Matched entries will have skip_wt_flag cleared (i.e. "in") |
| 1825 | */ |
| 1826 | clear_ce_flags(istate, select_flag, skip_wt_flag, pl, show_progress); |
| 1827 | } |
| 1828 | |
| 1829 | static void populate_from_existing_patterns(struct unpack_trees_options *o, |
| 1830 | struct pattern_list *pl) |
no test coverage detected