summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-18 09:23:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-18 09:23:56 (GMT)
commitc72431ffc9b48e8b9009e1f95afa9db9d87b099a (patch)
treeead69f276b8b3ccfcb4f59e51dd47417a7a9e88e /refs.c
parentbb6dd0ecad3561985ad91b06c37fa9d62e718db9 (diff)
parent9ab9b5df0ee2a49e0c1354a667e1e00db903f516 (diff)
downloadgit-c72431ffc9b48e8b9009e1f95afa9db9d87b099a.zip
git-c72431ffc9b48e8b9009e1f95afa9db9d87b099a.tar.gz
git-c72431ffc9b48e8b9009e1f95afa9db9d87b099a.tar.bz2
Merge branch 'ra/rev-parse-exclude-glob'
"rev-parse --exclude=<pattern> --branches=<pattern>" etc. did not quite work, which has been corrected. * ra/rev-parse-exclude-glob: refs: fix some exclude patterns being ignored refs: show --exclude failure with --branches/tags/remotes=glob
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/refs.c b/refs.c
index 17e4307..f993635 100644
--- a/refs.c
+++ b/refs.c
@@ -217,6 +217,7 @@ char *resolve_refdup(const char *refname, int resolve_flags,
/* The argument to filter_refs */
struct ref_filter {
const char *pattern;
+ const char *prefix;
each_ref_fn *fn;
void *cb_data;
};
@@ -296,6 +297,8 @@ static int filter_refs(const char *refname, const struct object_id *oid,
if (wildmatch(filter->pattern, refname, 0))
return 0;
+ if (filter->prefix)
+ skip_prefix(refname, filter->prefix, &refname);
return filter->fn(refname, oid, flags, filter->cb_data);
}
@@ -458,6 +461,7 @@ int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
}
filter.pattern = real_pattern.buf;
+ filter.prefix = prefix;
filter.fn = fn;
filter.cb_data = cb_data;
ret = for_each_ref(filter_refs, &filter);