git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joshua Jensen <jjensen@workspacewhiz.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Git 1.7.6: Sparse checkouts do not work with directory exclusions
Date: Mon, 19 Sep 2011 16:03:34 -0600	[thread overview]
Message-ID: <4E77BC36.7060005@workspacewhiz.com> (raw)

Sometime after Git 1.7.3.2, sparse checkouts stopped working for me.  My 
sparse-checkout file looks something like:

*
!DirA/
!DirB/
DirC/

I have restored some lines of code that were removed in November 2010.  
This resolves the sparse checkout issue for me, but my guess is the 
solution is not implemented properly.

Can anyone confirm the issue and describe why those lines were removed?

Thanks.

Josh

---
  dir.c |    5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dir.c b/dir.c
index 6e4494e..3f057b6 100644
--- a/dir.c
+++ b/dir.c
@@ -507,7 +507,10 @@ int excluded_from_list(const char *pathname,
              int to_exclude = x->to_exclude;

              if (x->flags & EXC_FLAG_MUSTBEDIR) {
-                if (*dtype == DT_UNKNOWN)
+                if (!prefixcmp(pathname, exclude) &&
+                    pathname[x->patternlen] == '/')
+                    return to_exclude;
+                else if (*dtype == DT_UNKNOWN)
                      *dtype = get_dtype(NULL, pathname, pathlen);
                  if (*dtype != DT_DIR)
                      continue;
-- 
1.7.6.msysgit.1

             reply	other threads:[~2011-09-19 22:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-19 22:03 Joshua Jensen [this message]
2011-09-20 10:09 ` Git 1.7.6: Sparse checkouts do not work with directory exclusions Nguyen Thai Ngoc Duy
2011-09-20 15:22   ` Joshua Jensen
2011-09-20 14:38 ` Michael J Gruber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E77BC36.7060005@workspacewhiz.com \
    --to=jjensen@workspacewhiz.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).