diff options
author | Vicent Martà <tanoku@gmail.com> | 2012-05-02 15:59:02 -0700 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2012-05-02 15:59:02 -0700 |
commit | 40879facad0337d954d4904e212af3b36cdb9465 (patch) | |
tree | aea730551948c67bb1fb88098cf8a67d3ed3211d /tests-clar/diff/diff_helpers.c | |
parent | 2218fd57a50ceb851cb131939bf0747e072e40f6 (diff) | |
parent | 3fd99be98a91416dae77d65fe593965a0723fa8c (diff) | |
download | libgit2-40879facad0337d954d4904e212af3b36cdb9465.tar.gz |
Merge branch 'new-error-handling' into development
Conflicts:
.travis.yml
include/git2/diff.h
src/config_file.c
src/diff.c
src/diff_output.c
src/mwindow.c
src/path.c
tests-clar/clar_helpers.c
tests-clar/object/tree/frompath.c
tests/t00-core.c
tests/t03-objwrite.c
tests/t08-tag.c
tests/t10-refs.c
tests/t12-repo.c
tests/t18-status.c
tests/test_helpers.c
tests/test_main.c
Diffstat (limited to 'tests-clar/diff/diff_helpers.c')
-rw-r--r-- | tests-clar/diff/diff_helpers.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/tests-clar/diff/diff_helpers.c b/tests-clar/diff/diff_helpers.c index d8eca7d9b..74a44ab99 100644 --- a/tests-clar/diff/diff_helpers.c +++ b/tests-clar/diff/diff_helpers.c @@ -5,10 +5,10 @@ git_tree *resolve_commit_oid_to_tree( git_repository *repo, const char *partial_oid) { - size_t len = strlen(partial_oid); + unsigned int len = (unsigned int)strlen(partial_oid); git_oid oid; - git_object *obj; - git_tree *tree; + git_object *obj = NULL; + git_tree *tree = NULL; if (git_oid_fromstrn(&oid, partial_oid, len) == 0) git_object_lookup_prefix(&obj, repo, &oid, len, GIT_OBJ_ANY); @@ -27,7 +27,9 @@ int diff_file_fn( float progress) { diff_expects *e = cb_data; - (void)progress; + + GIT_UNUSED(progress); + e->files++; switch (delta->status) { case GIT_DELTA_ADDED: e->file_adds++; break; @@ -48,9 +50,11 @@ int diff_hunk_fn( size_t header_len) { diff_expects *e = cb_data; - (void)delta; - (void)header; - (void)header_len; + + GIT_UNUSED(delta); + GIT_UNUSED(header); + GIT_UNUSED(header_len); + e->hunks++; e->hunk_old_lines += range->old_lines; e->hunk_new_lines += range->new_lines; @@ -60,14 +64,18 @@ int diff_hunk_fn( int diff_line_fn( void *cb_data, git_diff_delta *delta, + git_diff_range *range, char line_origin, const char *content, size_t content_len) { diff_expects *e = cb_data; - (void)delta; - (void)content; - (void)content_len; + + GIT_UNUSED(delta); + GIT_UNUSED(range); + GIT_UNUSED(content); + GIT_UNUSED(content_len); + e->lines++; switch (line_origin) { case GIT_DIFF_LINE_CONTEXT: |