diff --git a/crates/gitbutler-branch-actions/src/status.rs b/crates/gitbutler-branch-actions/src/status.rs index 31096eb61a..97e12d4996 100644 --- a/crates/gitbutler-branch-actions/src/status.rs +++ b/crates/gitbutler-branch-actions/src/status.rs @@ -98,7 +98,7 @@ pub fn get_applied_status_cached( let vb_state = ctx.project().virtual_branches(); let default_target = vb_state.get_default_target()?; - let locks = if ctx.project().use_new_locking { + let locks = if ctx.project().use_experimental_locking { compute_locks( ctx, &workspace_head, diff --git a/crates/gitbutler-branch-actions/tests/virtual_branches/mod.rs b/crates/gitbutler-branch-actions/tests/virtual_branches/mod.rs index f181eb677b..87265ae038 100644 --- a/crates/gitbutler-branch-actions/tests/virtual_branches/mod.rs +++ b/crates/gitbutler-branch-actions/tests/virtual_branches/mod.rs @@ -34,7 +34,7 @@ impl Default for Test { .add(test_project.path()) .expect("failed to add project"); // TODO: Remove after transition is complete. - project.use_new_locking = true; + project.use_experimental_locking = true; Self { repository: test_project, diff --git a/crates/gitbutler-project/src/project.rs b/crates/gitbutler-project/src/project.rs index b69499e866..a52ccf1bb2 100644 --- a/crates/gitbutler-project/src/project.rs +++ b/crates/gitbutler-project/src/project.rs @@ -98,8 +98,13 @@ pub struct Project { #[serde(default)] pub git_host: GitHostSettings, // Experimental flag for new hunk dependency algorithm - #[serde(default)] - pub use_new_locking: bool, + #[serde(default = "default_true")] + pub use_experimental_locking: bool, +} + +// TODO: Remove after `use_experimental` has been removed. +fn default_true() -> bool { + true } #[derive(Debug, Deserialize, Serialize, Clone, Default)] diff --git a/crates/gitbutler-project/src/storage.rs b/crates/gitbutler-project/src/storage.rs index b8abbdf768..1e2d280dfb 100644 --- a/crates/gitbutler-project/src/storage.rs +++ b/crates/gitbutler-project/src/storage.rs @@ -130,7 +130,7 @@ impl Storage { } if let Some(use_new_locking) = &update_request.use_new_locking { - project.use_new_locking = *use_new_locking; + project.use_experimental_locking = *use_new_locking; } self.inner