From: Junio C Hamano Date: Wed, 19 Dec 2012 21:30:57 GMT Subject: Re: [PATCH] add core.pathspecGlob config option Message-ID: <7vfw3191bi.fsf@alter.siamese.dyndns.org> In-Reply-To: <20121219203449.GA10001@sigill.intra.peff.net> Jeff King writes: > diff --git a/dir.c b/dir.c > index 5a83aa7..6e81d4f 100644 > --- a/dir.c > +++ b/dir.c > @@ -126,7 +126,7 @@ static int match_one(const char *match, const char *name, int namelen) > for (;;) { > unsigned char c1 = tolower(*match); > unsigned char c2 = tolower(*name); > - if (c1 == '\0' || is_glob_special(c1)) > + if (c1 == '\0' || (core_pathspec_glob && is_glob_special(c1))) > break; > if (c1 != c2) > return 0; I think you can also do the same to the common_prefix(); we check for common leading directory prefix but punt upon seeing a directory component that has a glob character, and under the "literal" mode, it is not a special character.