diff options
author | Junio C Hamano <junkio@cox.net> | 2005-11-25 15:59:09 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-11-27 01:32:59 -0800 |
commit | ab9cb76f661c1794800361c27bc5a515245aaaef (patch) | |
tree | d13942115e4692463908c41efe7d2d7369a63d52 /setup.c | |
parent | 51b3c00e9d95371a9ad202204f01c5981f241b20 (diff) | |
download | git-ab9cb76f661c1794800361c27bc5a515245aaaef.tar.gz |
Repository format version check.
This adds the repository format version code, first done by
Martin Atukunda.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -154,6 +154,22 @@ static const char *setup_git_directory_1(void) return cwd + offset; } +int check_repository_format_version(const char *var, const char *value) +{ + if (strcmp(var, "core.repositoryformatversion") == 0) + repository_format_version = git_config_int(var, value); + return 0; +} + +int check_repository_format(void) +{ + git_config(check_repository_format_version); + if (GIT_REPO_VERSION < repository_format_version) + die ("Expected git repo version <= %d, found %d", + GIT_REPO_VERSION, repository_format_version); + return 0; +} + const char *setup_git_directory(void) { const char *retval = setup_git_directory_1(); |