diff options
| author | Edward Thomson <ethomson@github.com> | 2016-04-25 00:35:48 -0400 |
|---|---|---|
| committer | Edward Thomson <ethomson@github.com> | 2016-05-26 13:01:09 -0500 |
| commit | 7166bb16659790ae2b398e1e95c752f784f6f1d3 (patch) | |
| tree | 1cc3a26e908ed54f579f5595332ba62bbba5a49c /src/diff_generate.c | |
| parent | 94e488a056942f1bb1ebbe7c9f0c693937726609 (diff) | |
| download | libgit2-7166bb16659790ae2b398e1e95c752f784f6f1d3.tar.gz | |
introduce `git_diff_from_buffer` to parse diffs
Parse diff files into a `git_diff` structure.
Diffstat (limited to 'src/diff_generate.c')
| -rw-r--r-- | src/diff_generate.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/diff_generate.c b/src/diff_generate.c index 10bc15486..a996bf156 100644 --- a/src/diff_generate.c +++ b/src/diff_generate.c @@ -358,22 +358,6 @@ static const char *diff_mnemonic_prefix( return pfx; } -static int diff_entry_cmp(const void *a, const void *b) -{ - const git_index_entry *entry_a = a; - const git_index_entry *entry_b = b; - - return strcmp(entry_a->path, entry_b->path); -} - -static int diff_entry_icmp(const void *a, const void *b) -{ - const git_index_entry *entry_a = a; - const git_index_entry *entry_b = b; - - return strcasecmp(entry_a->path, entry_b->path); -} - void git_diff__set_ignore_case(git_diff *diff, bool ignore_case) { if (!ignore_case) { @@ -382,7 +366,7 @@ void git_diff__set_ignore_case(git_diff *diff, bool ignore_case) diff->strcomp = git__strcmp; diff->strncomp = git__strncmp; diff->pfxcomp = git__prefixcmp; - diff->entrycomp = diff_entry_cmp; + diff->entrycomp = git_diff__entry_cmp; git_vector_set_cmp(&diff->deltas, git_diff_delta__cmp); } else { @@ -391,7 +375,7 @@ void git_diff__set_ignore_case(git_diff *diff, bool ignore_case) diff->strcomp = git__strcasecmp; diff->strncomp = git__strncasecmp; diff->pfxcomp = git__prefixcmp_icase; - diff->entrycomp = diff_entry_icmp; + diff->entrycomp = git_diff__entry_icmp; git_vector_set_cmp(&diff->deltas, git_diff_delta__casecmp); } |
