summaryrefslogtreecommitdiff
path: root/ref-filter.c
diff options
context:
space:
mode:
Diffstat (limited to 'ref-filter.c')
-rw-r--r--ref-filter.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ref-filter.c b/ref-filter.c
index 35776838f4..bf7b70299b 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -2295,7 +2295,7 @@ static int cmp_ref_sorting(struct ref_sorting *s, struct ref_array_item *a, stru
if (va->value < vb->value)
cmp = -1;
else if (va->value == vb->value)
- cmp = cmp_fn(a->refname, b->refname);
+ cmp = 0;
else
cmp = 1;
}
@@ -2314,7 +2314,16 @@ static int compare_refs(const void *a_, const void *b_, void *ref_sorting)
if (cmp)
return cmp;
}
- return 0;
+ s = ref_sorting;
+ return s && s->ignore_case ?
+ strcasecmp(a->refname, b->refname) :
+ strcmp(a->refname, b->refname);
+}
+
+void ref_sorting_icase_all(struct ref_sorting *sorting, int flag)
+{
+ for (; sorting; sorting = sorting->next)
+ sorting->ignore_case = !!flag;
}
void ref_array_sort(struct ref_sorting *sorting, struct ref_array *array)