diff options
author | Ben Straub <bs@github.com> | 2012-11-29 15:05:04 -0800 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2012-11-30 13:12:14 -0800 |
commit | 2f8d30becb4801d869188d2d46ca1512843e8698 (patch) | |
tree | 603ee4d64529de316e1c83914705e83d46b38cad /src/diff.h | |
parent | 691776213947e59a3928aab09e97a64b65e990ab (diff) | |
download | libgit2-2f8d30becb4801d869188d2d46ca1512843e8698.tar.gz |
Deploy GIT_DIFF_OPTIONS_INIT
Diffstat (limited to 'src/diff.h')
-rw-r--r-- | src/diff.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/diff.h b/src/diff.h index 1e3be7593..1f45af1cd 100644 --- a/src/diff.h +++ b/src/diff.h @@ -61,5 +61,19 @@ extern bool git_diff_delta__should_skip( extern int git_diff__oid_for_file( git_repository *, const char *, uint16_t, git_off_t, git_oid *); + +GIT_INLINE(bool) git_diff__opts_has_valid_version(const git_diff_options *opts) +{ + if (!opts) + return true; + + if (opts->version > 0 && opts->version <= GIT_DIFF_OPTIONS_VERSION) + return true; + + giterr_set(GITERR_INVALID, "Invalid version %d in git_diff_options", opts->version); + return false; +} + + #endif |