summaryrefslogtreecommitdiff
path: root/builtin/for-each-ref.c
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2015-09-10 15:48:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-09-17 17:02:49 (GMT)
commitbef0e12becd72b94d6bb9e48859742f55a4afb53 (patch)
tree1bc0ddf13958d68103b21aca5b4f968bea558756 /builtin/for-each-ref.c
parent90c004085cfe65e1b290e5b5fc05817ec2c596a6 (diff)
downloadgit-bef0e12becd72b94d6bb9e48859742f55a4afb53.zip
git-bef0e12becd72b94d6bb9e48859742f55a4afb53.tar.gz
git-bef0e12becd72b94d6bb9e48859742f55a4afb53.tar.bz2
ref-filter: add option to match literal pattern
Since 'ref-filter' only has an option to match path names add an option for plain fnmatch pattern-matching. This is to support the pattern matching options which are used in `git tag -l` and `git branch -l` where we can match patterns like `git tag -l foo*` which would match all tags which has a "foo*" pattern. Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/for-each-ref.c')
-rw-r--r--builtin/for-each-ref.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index 40f343b..4e9f6c2 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -68,6 +68,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
git_config(git_default_config, NULL);
filter.name_patterns = argv;
+ filter.match_as_path = 1;
filter_refs(&array, &filter, FILTER_REFS_ALL | FILTER_REFS_INCLUDE_BROKEN);
ref_array_sort(sorting, &array);