summaryrefslogtreecommitdiff
path: root/src/status.c
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2012-11-30 16:31:42 -0800
committerBen Straub <bs@github.com>2012-11-30 16:31:42 -0800
commitc7231c45fecf6c0ae91815a82db7e98c94689497 (patch)
tree33426a5463917d64b1f160f8083f3dfbd4217fe3 /src/status.c
parent4ec197f3049d203739066e0c2d2c5c39f78fd808 (diff)
downloadlibgit2-c7231c45fecf6c0ae91815a82db7e98c94689497.tar.gz
Deploy GITERR_CHECK_VERSION
Diffstat (limited to 'src/status.c')
-rw-r--r--src/status.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/status.c b/src/status.c
index f23f40e6d..1ad835adb 100644
--- a/src/status.c
+++ b/src/status.c
@@ -101,18 +101,6 @@ static int status_invoke_cb(
return usercb->cb(path, status, usercb->payload);
}
-static bool options_have_valid_version(const git_status_options *opts)
-{
- if (!opts)
- return true;
-
- if (opts->version > 0 && opts->version <= GIT_REMOTE_CALLBACKS_VERSION)
- return true;
-
- giterr_set(GITERR_INVALID, "Invalid version %d for git_repository_init_options", opts->version);
- return false;
-}
-
int git_status_foreach_ext(
git_repository *repo,
const git_status_options *opts,
@@ -129,8 +117,7 @@ int git_status_foreach_ext(
assert(show <= GIT_STATUS_SHOW_INDEX_THEN_WORKDIR);
- if (!options_have_valid_version(opts))
- return -1;
+ GITERR_CHECK_VERSION(opts, GIT_STATUS_OPTIONS_VERSION, "git_status_options");
if (show != GIT_STATUS_SHOW_INDEX_ONLY &&
(err = git_repository__ensure_not_bare(repo, "status")) < 0)