git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Confused about sparse vs untracked-cache
@ 2015-07-30  2:32 David Turner
  2015-07-30 14:09 ` Duy Nguyen
  0 siblings, 1 reply; 5+ messages in thread
From: David Turner @ 2015-07-30  2:32 UTC (permalink / raw)
  To: git mailing list, Duy Nguyen

I'm looking at dir.c, and there's a bit I'm confused about:

prep_exclude() says:
		     /*
		      * .. and .gitignore does not exist before
		      * (i.e. null exclude_sha1 and skip_worktree is
		      * not set). Then we can skip loading .gitignore,
		      * which would result in ENOENT anyway.
		      * skip_worktree is taken care in read_directory()
		      */
		     !is_null_sha1(untracked->exclude_sha1))) {

That "skip_worktree is taken care in read_directory()" appears to be
referring to this bit of validate_untracked_cache():
	/*
	 * An optimization in prep_exclude() does not play well with
	 * CE_SKIP_WORKTREE. It's a rare case anyway, if a single
	 * entry has that bit set, disable the whole untracked cache.
	 */
	for (i = 0; i < active_nr; i++)
		if (ce_skip_worktree(active_cache[i]))
			return NULL;
------------
I'm confused about why skip_worktree needs to be unset.  When I comment
out the second snippet, all the tests still pass.  What was the reason
behind that condition?  Is it really necessary?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-31 11:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-30  2:32 Confused about sparse vs untracked-cache David Turner
2015-07-30 14:09 ` Duy Nguyen
2015-07-30 23:30   ` David Turner
2015-07-31  5:13     ` David Turner
2015-07-31 11:28       ` Duy Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).