summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2015-07-31 13:35:01 -0400
committerJunio C Hamano <gitster@pobox.com>2015-07-31 10:56:18 -0700
commit7687252f3f7def11a862a0fd118c531ee630bd05 (patch)
tree58f6513e91b6a361257b0700ee1fe977caac59f1 /dir.c
parenta17c56c056d5fea0843b429132904c429a900229 (diff)
downloadgit-7687252f3f7def11a862a0fd118c531ee630bd05.tar.gz
untracked-cache: support sparse checkout
Remove a check that would disable the untracked cache for sparse checkouts. Add tests that ensure that the untracked cache works with sparse checkouts -- specifically considering the case that a file foo/bar is checked out, but foo/.gitignore is not. Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/dir.c b/dir.c
index 8209f8b8af..e7b89fe6fe 100644
--- a/dir.c
+++ b/dir.c
@@ -1078,10 +1078,9 @@ static void prep_exclude(struct dir_struct *dir, const char *base, int baselen)
(!untracked || !untracked->valid ||
/*
* .. 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()
+ * (i.e. null exclude_sha1). Then we can skip
+ * loading .gitignore, which would result in
+ * ENOENT anyway.
*/
!is_null_sha1(untracked->exclude_sha1))) {
/*
@@ -1880,7 +1879,6 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d
const struct pathspec *pathspec)
{
struct untracked_cache_dir *root;
- int i;
if (!dir->untracked || getenv("GIT_DISABLE_UNTRACKED_CACHE"))
return NULL;
@@ -1932,15 +1930,6 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d
if (dir->exclude_list_group[EXC_CMDL].nr)
return NULL;
- /*
- * 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;
-
if (!ident_in_untracked(dir->untracked)) {
warning(_("Untracked cache is disabled on this system."));
return NULL;