Skip to content

Commit

Permalink
Default to experimental locking
Browse files Browse the repository at this point in the history
- changing the name of the field since existing projects would have an explicit false value already
  • Loading branch information
mtsgrd committed Oct 28, 2024
1 parent 7a03e89 commit 69a1997
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/gitbutler-branch-actions/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 7 additions & 2 deletions crates/gitbutler-project/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion crates/gitbutler-project/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 69a1997

Please sign in to comment.