summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-02-10 13:20:08 -0800
committerRussell Belfer <rb@github.com>2014-04-17 14:43:45 -0700
commit3b4c401a38ce912d5be8c9bf4ab1c4912a4f08bd (patch)
tree4961b64fd558e1e55e9d1d96b37ca575c42ce008 /src/util.c
parentdac160489bbf8de90d2f1ae152df68ded2603598 (diff)
downloadlibgit2-3b4c401a38ce912d5be8c9bf4ab1c4912a4f08bd.tar.gz
Decouple index iterator sort from index
This makes the index iterator honor the GIT_ITERATOR_IGNORE_CASE and GIT_ITERATOR_DONT_IGNORE_CASE flags without modifying the index data itself. To take advantage of this, I had to export a number of the internal index entry comparison functions. I also wrote some new tests to exercise the capability.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util.c b/src/util.c
index 3767b890c..39858254f 100644
--- a/src/util.c
+++ b/src/util.c
@@ -542,10 +542,12 @@ int git__bsearch_r(
*/
int git__strcmp_cb(const void *a, const void *b)
{
- const char *stra = (const char *)a;
- const char *strb = (const char *)b;
+ return strcmp((const char *)a, (const char *)b);
+}
- return strcmp(stra, strb);
+int git__strcasecmp_cb(const void *a, const void *b)
+{
+ return strcasecmp((const char *)a, (const char *)b);
}
int git__parse_bool(int *out, const char *value)