summaryrefslogtreecommitdiff
path: root/src/diff.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-30 11:16:31 -0700
committerRussell Belfer <rb@github.com>2014-04-30 11:16:31 -0700
commit8655a8985bcf2891390d464401b198d629edbfc3 (patch)
tree342130ee269448aa7b31c37f56df9d2b02f63abb /src/diff.c
parenta4f9e1f0d41a9c78b304d3c1b8ef5270c30b208f (diff)
downloadlibgit2-rb/diff-update-index-stat-cache.tar.gz
Fix remaining init_options inconsistenciesrb/diff-update-index-stat-cache
There were a couple of "init_opts()" functions a few more cases of structure initialization that I somehow missed.
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/diff.c b/src/diff.c
index 56f333f76..781f23ec6 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1310,17 +1310,10 @@ int git_diff_is_sorted_icase(const git_diff *diff)
return (diff->opts.flags & GIT_DIFF_IGNORE_CASE) != 0;
}
-static int diff_options_bad_version(int version, const char *thing)
-{
- giterr_set(GITERR_INVALID, "Invalid version %d for %s", version, thing);
- return -1;
-}
-
int git_diff_get_perfdata(git_diff_perfdata *out, const git_diff *diff)
{
- if (!out || out->version != GIT_DIFF_PERFDATA_VERSION)
- return diff_options_bad_version(
- out ? out->version : 0, "git_diff_perfdata");
+ assert(out);
+ GITERR_CHECK_VERSION(out, GIT_DIFF_PERFDATA_VERSION, "git_diff_perfdata");
out->stat_calls = diff->perf.stat_calls;
out->oid_calculations = diff->perf.oid_calculations;
return 0;