diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-07-14 11:19:24 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-14 11:19:24 -0700 |
| commit | 5e458c1cfbc1382587ba0f00cc752981df758a4d (patch) | |
| tree | 7378fb5f30d398110b43a7d67ebf0a0c5afe4db5 /setup.c | |
| parent | 50d9c342b401d8040cfc484774b38d12474bbe8e (diff) | |
| parent | 793b14e1c833dd4ea0d85cdef53cc5ab38f7915e (diff) | |
| download | git-5e458c1cfbc1382587ba0f00cc752981df758a4d.tar.xz | |
Merge branch 'ps/use-reftable-as-default-in-3.0'
The reftable ref backend has matured enough; Git 3.0 will make it
the default format in a newly created repositories by default.
* ps/use-reftable-as-default-in-3.0:
setup: use "reftable" format when experimental features are enabled
BreakingChanges: announce switch to "reftable" format
Diffstat (limited to 'setup.c')
| -rw-r--r-- | setup.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -2484,6 +2484,18 @@ static int read_default_format_config(const char *key, const char *value, goto out; } + /* + * Enable the reftable format when "features.experimental" is enabled. + * "init.defaultRefFormat" takes precedence over this setting. + */ + if (!strcmp(key, "feature.experimental") && + cfg->ref_format == REF_STORAGE_FORMAT_UNKNOWN && + git_config_bool(key, value)) { + cfg->ref_format = REF_STORAGE_FORMAT_REFTABLE; + ret = 0; + goto out; + } + ret = 0; out: free(str); @@ -2544,6 +2556,8 @@ static void repository_format_configure(struct repository_format *repo_fmt, repo_fmt->ref_storage_format = ref_format; } else if (cfg.ref_format != REF_STORAGE_FORMAT_UNKNOWN) { repo_fmt->ref_storage_format = cfg.ref_format; + } else { + repo_fmt->ref_storage_format = REF_STORAGE_FORMAT_DEFAULT; } repo_set_ref_storage_format(the_repository, repo_fmt->ref_storage_format); } |
