diff options
| author | Ben Straub <bs@github.com> | 2012-11-30 16:31:42 -0800 |
|---|---|---|
| committer | Ben Straub <bs@github.com> | 2012-11-30 16:31:42 -0800 |
| commit | c7231c45fecf6c0ae91815a82db7e98c94689497 (patch) | |
| tree | 33426a5463917d64b1f160f8083f3dfbd4217fe3 /src/config.c | |
| parent | 4ec197f3049d203739066e0c2d2c5c39f78fd808 (diff) | |
| download | libgit2-c7231c45fecf6c0ae91815a82db7e98c94689497.tar.gz | |
Deploy GITERR_CHECK_VERSION
Diffstat (limited to 'src/config.c')
| -rw-r--r-- | src/config.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/config.c b/src/config.c index 913108abb..d422447cf 100644 --- a/src/config.c +++ b/src/config.c @@ -248,18 +248,6 @@ int git_config_open_level( return 0; } -static bool config_backend_has_valid_version(git_config_backend *backend) -{ - if (!backend) - return true; - - if (backend->version > 0 && backend->version <= GIT_CONFIG_BACKEND_VERSION) - return true; - - giterr_set(GITERR_INVALID, "Invalid version %d for git_config_backend", backend->version); - return false; -} - int git_config_add_backend( git_config *cfg, git_config_backend *file, @@ -271,8 +259,7 @@ int git_config_add_backend( assert(cfg && file); - if (!config_backend_has_valid_version(file)) - return -1; + GITERR_CHECK_VERSION(file, GIT_CONFIG_BACKEND_VERSION, "git_config_backend"); if ((result = file->open(file, level)) < 0) return result; |
