summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 97d0b74)
raw | patch | inline | side by side (parent: 97d0b74)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 5 Apr 2011 16:30:36 +0000 (09:30 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 5 Apr 2011 16:30:36 +0000 (09:30 -0700) |
As the point of the last change is to allow use of strings as
literals no matter what characters are in them, "has_wildcard"
does not match what we use this field for anymore.
It is used to decide if the wildcard matching should be used, so
rename it to match the usage better.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
literals no matter what characters are in them, "has_wildcard"
does not match what we use this field for anymore.
It is used to decide if the wildcard matching should be used, so
rename it to match the usage better.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/ls-files.c | patch | blob | history | |
builtin/ls-tree.c | patch | blob | history | |
cache.h | patch | blob | history | |
dir.c | patch | blob | history | |
tree-walk.c | patch | blob | history |
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index 199af46360b4d8cefc448a2384bacd083311d76c..15701233e29b240cfa1abdb56bd489306e74c677 100644 (file)
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
matchbuf[0] = prefix;
matchbuf[1] = NULL;
init_pathspec(&pathspec, matchbuf);
- pathspec.items[0].has_wildcard = 0;
+ pathspec.items[0].use_wildcard = 0;
} else
init_pathspec(&pathspec, NULL);
if (read_tree(tree, 1, &pathspec))
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 4290723392141938c7099eaa870bd05754f41ec4..f08c5b0c942eec58b85ab41e5e5fb1ec216df683 100644 (file)
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
init_pathspec(&pathspec, get_pathspec(prefix, argv + 1));
for (i = 0; i < pathspec.nr; i++)
- pathspec.items[i].has_wildcard = 0;
+ pathspec.items[i].use_wildcard = 0;
+ pathspec.has_wildcard = 0;
tree = parse_tree_indirect(sha1);
if (!tree)
die("not a tree object");
index edd5b5ad8fc28440954b1066f304eab86e6a64d1..43d719d71f233c7b433f7097864a147010267e18 100644 (file)
--- a/cache.h
+++ b/cache.h
struct pathspec_item {
const char *match;
int len;
- unsigned int has_wildcard:1;
+ unsigned int use_wildcard:1;
} *items;
};
index 168dad615230d77d7719101b76b50b4f6fe02777..91f1502ac6827a2f4392561d0314f41898dcfb5d 100644 (file)
--- a/dir.c
+++ b/dir.c
return MATCHED_RECURSIVELY;
}
- if (item->has_wildcard && !fnmatch(match, name, 0))
+ if (item->use_wildcard && !fnmatch(match, name, 0))
return MATCHED_FNMATCH;
return 0;
item->match = path;
item->len = strlen(path);
- item->has_wildcard = !no_wildcard(path);
- if (item->has_wildcard)
+ item->use_wildcard = !no_wildcard(path);
+ if (item->use_wildcard)
pathspec->has_wildcard = 1;
}
diff --git a/tree-walk.c b/tree-walk.c
index 322becc3b4ad50b8e87fae8f6d5d38f7edc51f01..33f749e1e77484694e7b8f40a65755a7818c4abb 100644 (file)
--- a/tree-walk.c
+++ b/tree-walk.c
&never_interesting))
return 1;
- if (ps->items[i].has_wildcard) {
+ if (ps->items[i].use_wildcard) {
if (!fnmatch(match + baselen, entry->path, 0))
return 1;
}
match_wildcards:
- if (!ps->items[i].has_wildcard)
+ if (!ps->items[i].use_wildcard)
continue;
/*