Merge branch 'dt/untracked-sparse'
authorJunio C Hamano <gitster@pobox.com>
Mon, 17 Aug 2015 22:07:52 +0000 (15:07 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Aug 2015 22:07:52 +0000 (15:07 -0700)
Allow untracked cache (experimental) to be used when sparse
checkout (experimental) is also in use.

* dt/untracked-sparse:
untracked-cache: support sparse checkout

1  2 
dir.c
diff --combined dir.c
index 1d42811cfb29009d75b95e4d24ebd67f5215e326,e7b89fe6fee9b73e2e6868790cf45caab8cdbdc5..3881f55c71f1745f68a0dcaf5b439e3518b8909d
--- 1/dir.c
--- 2/dir.c
+++ b/dir.c
@@@ -1078,10 -1078,9 +1078,9 @@@ static void prep_exclude(struct dir_str
                    (!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))) {
                        /*
@@@ -1848,7 -1847,7 +1847,7 @@@ static const char *get_ident_string(voi
  
        if (sb.len)
                return sb.buf;
 -      if (uname(&uts))
 +      if (uname(&uts) < 0)
                die_errno(_("failed to get kernel name and information"));
        strbuf_addf(&sb, "Location %s, system %s %s %s", get_git_work_tree(),
                    uts.sysname, uts.release, uts.version);
@@@ -1880,7 -1879,6 +1879,6 @@@ static struct untracked_cache_dir *vali
                                                      const struct pathspec *pathspec)
  {
        struct untracked_cache_dir *root;
-       int i;
  
        if (!dir->untracked || getenv("GIT_DISABLE_UNTRACKED_CACHE"))
                return NULL;
        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;