summaryrefslogtreecommitdiffstats
path: root/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/setup.c b/setup.c
index 597b41b822..e34b073577 100644
--- a/setup.c
+++ b/setup.c
@@ -455,7 +455,6 @@ static int check_repo_format(const char *var, const char *value, void *vdata)
if (strcmp(var, "core.repositoryformatversion") == 0)
data->version = git_config_int(var, value);
else if (skip_prefix(var, "extensions.", &ext)) {
- data->has_extensions = 1;
/*
* record any known extensions here; otherwise,
* we fall through to recording it as unknown, and
@@ -553,13 +552,16 @@ int upgrade_repository_format(int target_version)
if (repo_fmt.version >= target_version)
return 0;
- if (verify_repository_format(&repo_fmt, &err) < 0 ||
- (!repo_fmt.version && repo_fmt.has_extensions)) {
- warning("unable to upgrade repository format from %d to %d: %s",
- repo_fmt.version, target_version, err.buf);
+ if (verify_repository_format(&repo_fmt, &err) < 0) {
+ error("cannot upgrade repository format from %d to %d: %s",
+ repo_fmt.version, target_version, err.buf);
strbuf_release(&err);
return -1;
}
+ if (!repo_fmt.version && repo_fmt.unknown_extensions.nr)
+ return error("cannot upgrade repository format: "
+ "unknown extension %s",
+ repo_fmt.unknown_extensions.items[0].string);
strbuf_addf(&repo_version, "%d", target_version);
git_config_set("core.repositoryformatversion", repo_version.buf);