Skip to content

Commit 24d67b4

Browse files
committed
Make apply_branch private
1 parent df83d28 commit 24d67b4

File tree

6 files changed

+241
-359
lines changed

6 files changed

+241
-359
lines changed

crates/gitbutler-core/src/ops/snapshot.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ use super::entry::Trailer;
1111

1212
/// Snapshot functionality
1313
impl Project {
14-
pub(crate) fn snapshot_branch_applied(
15-
&self,
16-
snapshot_tree: git2::Oid,
17-
result: Result<&String, &anyhow::Error>,
18-
) -> anyhow::Result<()> {
19-
let result = result.map(|o| Some(o.clone()));
20-
let details = SnapshotDetails::new(OperationKind::ApplyBranch)
21-
.with_trailers(result_trailer(result, "name".to_string()));
22-
self.commit_snapshot(snapshot_tree, details)?;
23-
Ok(())
24-
}
2514
pub(crate) fn snapshot_branch_unapplied(
2615
&self,
2716
snapshot_tree: git2::Oid,

crates/gitbutler-core/src/virtual_branches/controller.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,6 @@ impl Controller {
184184
.await
185185
}
186186

187-
pub async fn apply_virtual_branch(
188-
&self,
189-
project_id: ProjectId,
190-
branch_id: BranchId,
191-
) -> Result<()> {
192-
self.inner(project_id)
193-
.await
194-
.apply_virtual_branch(project_id, branch_id)
195-
.await
196-
}
197-
198187
pub async fn unapply_ownership(
199188
&self,
200189
project_id: ProjectId,
@@ -601,27 +590,6 @@ impl ControllerInner {
601590
})
602591
}
603592

604-
pub async fn apply_virtual_branch(
605-
&self,
606-
project_id: ProjectId,
607-
branch_id: BranchId,
608-
) -> Result<()> {
609-
let _permit = self.semaphore.acquire().await;
610-
611-
self.with_verify_branch(project_id, |project_repository, user| {
612-
let snapshot_tree = project_repository.project().prepare_snapshot();
613-
let result =
614-
super::apply_branch(project_repository, branch_id, user).map_err(Into::into);
615-
616-
let _ = snapshot_tree.and_then(|snapshot_tree| {
617-
project_repository
618-
.project()
619-
.snapshot_branch_applied(snapshot_tree, result.as_ref())
620-
});
621-
result.map(|_| ())
622-
})
623-
}
624-
625593
pub async fn unapply_ownership(
626594
&self,
627595
project_id: ProjectId,

0 commit comments

Comments
 (0)