Commit 608d0466 by Russell Belfer

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.
parent a5df71c1
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment