diff options
author | joshaber <joshaber@gmail.com> | 2015-07-22 11:33:18 -0400 |
---|---|---|
committer | joshaber <joshaber@gmail.com> | 2015-07-22 11:33:18 -0400 |
commit | 9830fbba05ef66325f929a09407abc45ab85847d (patch) | |
tree | dac363428f4705a632719e03b8b77f2d32ce2bb3 /src/diff.c | |
parent | cf198fdf2a044d2e2f0675c2c6b1cd9cdbcf4fcf (diff) | |
parent | 42156d561723e92ffe597885719aa63abfe0795c (diff) | |
download | libgit2-fix-init-ordering.tar.gz |
Merge branch 'master' into fix-init-orderingfix-init-ordering
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/diff.c b/src/diff.c index c1adcc662..44f627880 100644 --- a/src/diff.c +++ b/src/diff.c @@ -1421,6 +1421,31 @@ int git_diff_tree_to_workdir_with_index( return error; } +int git_diff_index_to_index( + git_diff **diff, + git_repository *repo, + git_index *old_index, + git_index *new_index, + const git_diff_options *opts) +{ + int error = 0; + + assert(diff && old_index && new_index); + + DIFF_FROM_ITERATORS( + git_iterator_for_index( + &a, old_index, GIT_ITERATOR_DONT_IGNORE_CASE, pfx, pfx), + git_iterator_for_index( + &b, new_index, GIT_ITERATOR_DONT_IGNORE_CASE, pfx, pfx) + ); + + /* if index is in case-insensitive order, re-sort deltas to match */ + if (!error && (old_index->ignore_case || new_index->ignore_case)) + diff_set_ignore_case(*diff, true); + + return error; +} + size_t git_diff_num_deltas(const git_diff *diff) { assert(diff); |