summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-07-14 15:36:06 +0700
committerJunio C Hamano <gitster@pobox.com>2013-07-15 10:56:09 -0700
commit5c6933d201fab183a9779dca0fe43bf2f1eca098 (patch)
treef22da1c0e6a14ef6cc6cc8cfe824bbdb971aeb48 /dir.c
parent341003e715c9a7c0332d3f8f08c2f3696a057565 (diff)
downloadgit-5c6933d201fab183a9779dca0fe43bf2f1eca098.tar.gz
pathspec: support :(literal) syntax for noglob pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/dir.c b/dir.c
index 79465e7f4c..50ec2f5478 100644
--- a/dir.c
+++ b/dir.c
@@ -108,7 +108,10 @@ static size_t common_prefix_len(const struct pathspec *pathspec)
int n;
size_t max = 0;
- GUARD_PATHSPEC(pathspec, PATHSPEC_FROMTOP | PATHSPEC_MAXDEPTH);
+ GUARD_PATHSPEC(pathspec,
+ PATHSPEC_FROMTOP |
+ PATHSPEC_MAXDEPTH |
+ PATHSPEC_LITERAL);
for (n = 0; n < pathspec->nr; n++) {
size_t i = 0, len = 0;
@@ -232,7 +235,10 @@ int match_pathspec_depth(const struct pathspec *ps,
{
int i, retval = 0;
- GUARD_PATHSPEC(ps, PATHSPEC_FROMTOP | PATHSPEC_MAXDEPTH);
+ GUARD_PATHSPEC(ps,
+ PATHSPEC_FROMTOP |
+ PATHSPEC_MAXDEPTH |
+ PATHSPEC_LITERAL);
if (!ps->nr) {
if (!ps->recursive ||
@@ -1288,7 +1294,10 @@ int read_directory(struct dir_struct *dir, const char *path, int len, const stru
* Check out create_simplify()
*/
if (pathspec)
- GUARD_PATHSPEC(pathspec, PATHSPEC_FROMTOP | PATHSPEC_MAXDEPTH);
+ GUARD_PATHSPEC(pathspec,
+ PATHSPEC_FROMTOP |
+ PATHSPEC_MAXDEPTH |
+ PATHSPEC_LITERAL);
if (has_symlink_leading_path(path, len))
return dir->nr;