summaryrefslogtreecommitdiff
path: root/ref-filter.c
diff options
context:
space:
mode:
Diffstat (limited to 'ref-filter.c')
-rw-r--r--ref-filter.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/ref-filter.c b/ref-filter.c
index fa3685d..600774d 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -3,6 +3,8 @@
#include "parse-options.h"
#include "refs.h"
#include "wildmatch.h"
+#include "object-store.h"
+#include "repository.h"
#include "commit.h"
#include "remote.h"
#include "color.h"
@@ -805,7 +807,8 @@ static void *get_obj(const struct object_id *oid, struct object **obj, unsigned
void *buf = read_object_file(oid, &type, sz);
if (buf)
- *obj = parse_object_buffer(oid, type, *sz, buf, eaten);
+ *obj = parse_object_buffer(the_repository, oid, type, *sz,
+ buf, eaten);
else
*obj = NULL;
return buf;
@@ -1813,7 +1816,7 @@ static int match_name_as_path(const struct ref_filter *filter, const char *refna
refname[plen] == '/' ||
p[plen-1] == '/'))
return 1;
- if (!wildmatch(p, refname, WM_PATHNAME))
+ if (!wildmatch(p, refname, flags))
return 1;
}
return 0;
@@ -1868,6 +1871,15 @@ static int for_each_fullref_in_pattern(struct ref_filter *filter,
return for_each_fullref_in("", cb, cb_data, broken);
}
+ if (filter->ignore_case) {
+ /*
+ * we can't handle case-insensitive comparisons,
+ * so just return everything and let the caller
+ * sort it out.
+ */
+ return for_each_fullref_in("", cb, cb_data, broken);
+ }
+
if (!filter->name_patterns[0]) {
/* no patterns; we have to look at everything */
return for_each_fullref_in("", cb, cb_data, broken);
@@ -1913,7 +1925,7 @@ static const struct object_id *match_points_at(struct oid_array *points_at,
if (oid_array_lookup(points_at, oid) >= 0)
return oid;
- obj = parse_object(oid);
+ obj = parse_object(the_repository, oid);
if (!obj)
die(_("malformed object at '%s'"), refname);
if (obj->type == OBJ_TAG)
@@ -2023,7 +2035,8 @@ static int ref_filter_handler(const char *refname, const struct object_id *oid,
* non-commits early. The actual filtering is done later.
*/
if (filter->merge_commit || filter->with_commit || filter->no_commit || filter->verbose) {
- commit = lookup_commit_reference_gently(oid, 1);
+ commit = lookup_commit_reference_gently(the_repository, oid,
+ 1);
if (!commit)
return 0;
/* We perform the filtering for the '--contains' option... */
@@ -2380,7 +2393,8 @@ int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset)
if (get_oid(arg, &oid))
die(_("malformed object name %s"), arg);
- rf->merge_commit = lookup_commit_reference_gently(&oid, 0);
+ rf->merge_commit = lookup_commit_reference_gently(the_repository,
+ &oid, 0);
if (!rf->merge_commit)
return opterror(opt, "must point to a commit", 0);