From c7231c45fecf6c0ae91815a82db7e98c94689497 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Fri, 30 Nov 2012 16:31:42 -0800 Subject: Deploy GITERR_CHECK_VERSION --- src/config.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/config.c') 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; -- cgit v1.2.1