config: Save config file uncompressed

This commit is contained in:
Alexander Weiss 2023-03-17 10:20:10 +01:00
parent 73db1207ca
commit f5c64a10fc
2 changed files with 7 additions and 2 deletions

View File

@ -5,6 +5,7 @@ Breaking changes:
- Backing up multiple sources on the command line now results in one instead of several snapshots.
Bugs fixed:
- `config` command did save the config file compressed which violates the repo design. This is fixed.
New features:
- Experimental windows support has been added.

View File

@ -12,17 +12,21 @@ pub(super) struct Opts {
config_opts: ConfigOpts,
}
pub(super) fn execute(repo: OpenRepository, opts: Opts) -> Result<()> {
pub(super) fn execute(mut repo: OpenRepository, opts: Opts) -> Result<()> {
let mut new_config = repo.config.clone();
opts.config_opts.apply(&mut new_config)?;
if new_config != repo.config {
new_config.is_hot = None;
// don't compress the config file
repo.dbe.set_zstd(None);
// for hot/cold backend, this only saves the config to the cold repo.
repo.dbe.save_file(&new_config)?;
if let Some(hot_be) = repo.be_hot {
// save config to hot repo
let dbe = DecryptBackend::new(&hot_be, repo.key);
let mut dbe = DecryptBackend::new(&hot_be, repo.key);
// don't compress the config file
dbe.set_zstd(None);
new_config.is_hot = Some(true);
dbe.save_file(&new_config)?;
}