more possible mitigations for the "failed to apply" problemt related to merge conflicts

This commit is contained in:
Kiril Videlov 2024-07-21 22:30:24 +02:00
parent 10da0ae567
commit 54ae0cf9e8
No known key found for this signature in database
GPG Key ID: A4C733025427C471

View File

@ -80,6 +80,11 @@ impl BranchManager<'_> {
.context("failed to get status by branch")? .context("failed to get status by branch")?
.branches; .branches;
// doing this earlier in the flow, in case any of the steps that follow fail
vb_state
.mark_as_not_in_workspace(branch.id)
.context("Failed to remove branch")?;
// go through the other applied branches and merge them into the final tree // go through the other applied branches and merge them into the final tree
// then check that out into the working directory // then check that out into the working directory
let final_tree = applied_statuses let final_tree = applied_statuses
@ -116,10 +121,6 @@ impl BranchManager<'_> {
.checkout() .checkout()
.context("failed to checkout tree")?; .context("failed to checkout tree")?;
vb_state
.mark_as_not_in_workspace(branch.id)
.context("Failed to remove branch")?;
self.project_repository.delete_branch_reference(&branch)?; self.project_repository.delete_branch_reference(&branch)?;
ensure_selected_for_changes(&vb_state).context("failed to ensure selected for changes")?; ensure_selected_for_changes(&vb_state).context("failed to ensure selected for changes")?;