diff --git a/packages/tauri/src/gb_repository/repository.rs b/packages/tauri/src/gb_repository/repository.rs
index 41201a945..3361e8375 100644
--- a/packages/tauri/src/gb_repository/repository.rs
+++ b/packages/tauri/src/gb_repository/repository.rs
@@ -288,10 +288,8 @@ impl Repository {
// copy branches that we don't already have
for branch in &branches {
- let branch_copy = branch.clone();
- //branch_copy.applied = false;
dst_branch_writer
- .write(&branch_copy)
+ .write(&mut branch.clone())
.with_context(|| format!("{}: failed to write branch", branch.id))?;
}
diff --git a/packages/tauri/src/virtual_branches/base.rs b/packages/tauri/src/virtual_branches/base.rs
index 78982cdd7..28e2a1e47 100644
--- a/packages/tauri/src/virtual_branches/base.rs
+++ b/packages/tauri/src/virtual_branches/base.rs
@@ -176,7 +176,7 @@ pub fn set_base_branch(
(None, None)
};
- let branch = branch::Branch {
+ let mut branch = branch::Branch {
id: BranchId::generate(),
name: head_name.to_string().replace("refs/heads/", ""),
notes: String::new(),
@@ -196,7 +196,7 @@ pub fn set_base_branch(
};
let branch_writer = branch::Writer::new(gb_repository);
- branch_writer.write(&branch)?;
+ branch_writer.write(&mut branch)?;
}
}
@@ -294,106 +294,174 @@ pub fn update_base_branch(
let updated_vbranches = super::get_status_by_branch(gb_repository, project_repository)?
.into_iter()
.map(|(branch, _)| branch)
- .map(|branch: branch::Branch| -> Result