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

Function mark_new_skip_worktree

unpack-trees.c:1799–1827  ·  view source on GitHub ↗

* Set/Clear CE_NEW_SKIP_WORKTREE according to $GIT_DIR/info/sparse-checkout */

Source from the content-addressed store, hash-verified

1797 * Set/Clear CE_NEW_SKIP_WORKTREE according to $GIT_DIR/info/sparse-checkout
1798 */
1799static 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
1829static void populate_from_existing_patterns(struct unpack_trees_options *o,
1830 struct pattern_list *pl)

Callers 2

unpack_treesFunction · 0.85
update_sparsityFunction · 0.85

Calls 1

clear_ce_flagsFunction · 0.85

Tested by

no test coverage detected