diff options
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 |