mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
Fix include ignored migration rerunning (#41114)
Closes #ISSUE Release Notes: - Fixed an issue where having a correct `file_finder.include_ignored` setting would result in failed to migrate errors
This commit is contained in:
parent
bcbc6a330e
commit
e54c9da2a8
2 changed files with 15 additions and 2 deletions
|
|
@ -17,6 +17,7 @@ pub fn make_file_finder_include_ignored_an_enum(value: &mut Value) -> Result<()>
|
||||||
Value::Bool(true) => Value::String("all".to_string()),
|
Value::Bool(true) => Value::String("all".to_string()),
|
||||||
Value::Bool(false) => Value::String("indexed".to_string()),
|
Value::Bool(false) => Value::String("indexed".to_string()),
|
||||||
Value::Null => Value::String("smart".to_string()),
|
Value::Null => Value::String("smart".to_string()),
|
||||||
|
Value::String(s) if s == "all" || s == "indexed" || s == "smart" => return Ok(()),
|
||||||
_ => anyhow::bail!("Expected include_ignored to be a boolean or null"),
|
_ => anyhow::bail!("Expected include_ignored to be a boolean or null"),
|
||||||
};
|
};
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -366,7 +366,13 @@ mod tests {
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
fn assert_migrate_settings(input: &str, output: Option<&str>) {
|
fn assert_migrate_settings(input: &str, output: Option<&str>) {
|
||||||
let migrated = migrate_settings(input).unwrap();
|
let migrated = migrate_settings(input).unwrap();
|
||||||
assert_migrated_correctly(migrated, output);
|
assert_migrated_correctly(migrated.clone(), output);
|
||||||
|
|
||||||
|
// expect that rerunning the migration does not result in another migration
|
||||||
|
if let Some(migrated) = migrated {
|
||||||
|
let rerun = migrate_settings(&migrated).unwrap();
|
||||||
|
assert_migrated_correctly(rerun, None);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
|
|
@ -376,7 +382,13 @@ mod tests {
|
||||||
output: Option<&str>,
|
output: Option<&str>,
|
||||||
) {
|
) {
|
||||||
let migrated = run_migrations(input, migrations).unwrap();
|
let migrated = run_migrations(input, migrations).unwrap();
|
||||||
assert_migrated_correctly(migrated, output);
|
assert_migrated_correctly(migrated.clone(), output);
|
||||||
|
|
||||||
|
// expect that rerunning the migration does not result in another migration
|
||||||
|
if let Some(migrated) = migrated {
|
||||||
|
let rerun = run_migrations(&migrated, migrations).unwrap();
|
||||||
|
assert_migrated_correctly(rerun, None);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue