diff options
| author | Russell Belfer <rb@github.com> | 2013-04-22 13:51:35 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-04-23 12:57:30 -0700 |
| commit | 608d04667ae08e991c1ffa6f33573d15930245b3 (patch) | |
| tree | 8065e1474fa517400edabd72b4f98f86dba72fa2 /src | |
| parent | a5df71c11fef996d67593546fa1edb2865e6a5d9 (diff) | |
| download | libgit2-608d04667ae08e991c1ffa6f33573d15930245b3.tar.gz | |
Make tree to tree diffs case sensitive
When case insensitive tree iterators were added, we started reading
the case sensitivity of the index to decide if the tree should be
case sensitive. This is good for index-to-tree comparisons, but
for tree-to-tree comparisons, we should really default to doing a
case sensitive comparison unless the user really wants otherwise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/diff.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/diff.c b/src/diff.c index e6f5374e7..d9348bba8 100644 --- a/src/diff.c +++ b/src/diff.c @@ -870,12 +870,20 @@ int git_diff_tree_to_tree( const git_diff_options *opts) { int error = 0; + git_iterator_flag_t iflag = GIT_ITERATOR_DONT_IGNORE_CASE; assert(diff && repo); + /* for tree to tree diff, be case sensitive even if the index is + * currently case insensitive, unless the user explicitly asked + * for case insensitivity + */ + if (opts && (opts->flags & GIT_DIFF_DELTAS_ARE_ICASE) != 0) + iflag = GIT_ITERATOR_IGNORE_CASE; + DIFF_FROM_ITERATORS( - git_iterator_for_tree(&a, old_tree, 0, pfx, pfx), - git_iterator_for_tree(&b, new_tree, 0, pfx, pfx) + git_iterator_for_tree(&a, old_tree, iflag, pfx, pfx), + git_iterator_for_tree(&b, new_tree, iflag, pfx, pfx) ); return error; |
