[PATCH 5/7] Add support for case insensitive directory and file lookups to git log
This patch also affects any other commands that use tree-diff.c.
Signed-off-by: Joshua Jensen <jjensen@workspacewhiz.com>
---
tree-diff.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/tree-diff.c b/tree-diff.c
index fe9f52c..5110980 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -5,6 +5,7 @@
#include "diff.h"
#include "diffcore.h"
#include "tree.h"
+#include "dir.h"
static char *malloc_base(const char *base, int baselen, const char *path, int pathlen)
{
@@ -114,7 +115,7 @@ static int tree_entry_interesting(struct tree_desc *desc, const char *base, int
if (baselen >= matchlen) {
/* If it doesn't match, move along... */
- if (strncmp(base, match, matchlen))
+ if (strncmp_icase(base, match, matchlen))
continue;
/*
@@ -131,7 +132,7 @@ static int tree_entry_interesting(struct tree_desc *desc, const char *base, int
}
/* Does the base match? */
- if (strncmp(base, match, baselen))
+ if (strncmp_icase(base, match, baselen))
continue;
match += baselen;
@@ -147,7 +148,7 @@ static int tree_entry_interesting(struct tree_desc *desc, const char *base, int
* Does match sort strictly earlier than path
* with their common parts?
*/
- m = strncmp(match, path,
+ m = strncmp_icase(match, path,
(matchlen < pathlen) ? matchlen : pathlen);
if (m < 0)
continue;
@@ -183,7 +184,7 @@ static int tree_entry_interesting(struct tree_desc *desc, const char *base, int
* we cheated and did not do strncmp(), so we do
* that here.
*/
- m = strncmp(match, path, pathlen);
+ m = strncmp_icase(match, path, pathlen);
/*
* If common part matched earlier then it is a hit,
--
1.7.1.1930.gca7dd4