From a22006cee7ab2555faf2e4af5aa933bd336efaf1 Mon Sep 17 00:00:00 2001 From: Caleb Owens Date: Sat, 14 Dec 2024 02:07:45 +0100 Subject: [PATCH] stuffs --- .../src/lib/baseBranch/baseBranchService.ts | 2 +- .../gitbutler-branch-actions/src/actions.rs | 11 --- crates/gitbutler-branch-actions/src/lib.rs | 2 +- .../gitbutler-branch-actions/src/virtual.rs | 91 ++----------------- .../tests/virtual_branches/amend.rs | 4 +- .../create_virtual_branch_from_branch.rs | 8 +- .../tests/virtual_branches/init.rs | 5 - .../tests/virtual_branches/references.rs | 24 +++-- .../tests/virtual_branches/squash.rs | 4 +- .../virtual_branches/update_commit_message.rs | 4 +- .../tests/virtual_branches/upstream.rs | 12 ++- crates/gitbutler-tauri/src/app.rs | 9 +- crates/gitbutler-tauri/src/commands.rs | 3 +- crates/gitbutler-tauri/src/main.rs | 1 - .../gitbutler-tauri/src/virtual_branches.rs | 22 +---- 15 files changed, 48 insertions(+), 154 deletions(-) diff --git a/apps/desktop/src/lib/baseBranch/baseBranchService.ts b/apps/desktop/src/lib/baseBranch/baseBranchService.ts index 2787588025..853276ea69 100644 --- a/apps/desktop/src/lib/baseBranch/baseBranchService.ts +++ b/apps/desktop/src/lib/baseBranch/baseBranchService.ts @@ -109,7 +109,7 @@ export async function getRemoteBranches( projectId: string | undefined ): Promise { if (!projectId) return []; - return await invoke>('git_remote_branches', { projectId }).then((branches) => + return await invoke('git_remote_branches', { projectId }).then((branches) => branches .map((name) => name.substring(13)) .sort((a, b) => a.localeCompare(b)) diff --git a/crates/gitbutler-branch-actions/src/actions.rs b/crates/gitbutler-branch-actions/src/actions.rs index d3a310b6a5..9e8eb34da1 100644 --- a/crates/gitbutler-branch-actions/src/actions.rs +++ b/crates/gitbutler-branch-actions/src/actions.rs @@ -416,17 +416,6 @@ pub fn save_and_unapply_virutal_branch( result } -pub fn push_virtual_branch( - project: &Project, - stack_id: StackId, - with_force: bool, - askpass: Option>, -) -> Result { - let ctx = open_with_verify(project)?; - assure_open_workspace_mode(&ctx).context("Pushing a branch requires open workspace mode")?; - vbranch::push(&ctx, stack_id, with_force, askpass) -} - pub fn find_git_branches(project: Project, branch_name: &str) -> Result> { let ctx = CommandContext::open(&project)?; remote::find_git_branches(&ctx, branch_name) diff --git a/crates/gitbutler-branch-actions/src/lib.rs b/crates/gitbutler-branch-actions/src/lib.rs index 624b30df04..db7c372c24 100644 --- a/crates/gitbutler-branch-actions/src/lib.rs +++ b/crates/gitbutler-branch-actions/src/lib.rs @@ -7,7 +7,7 @@ pub use actions::{ find_git_branches, get_base_branch_data, get_uncommited_files, get_uncommited_files_reusable, insert_blank_commit, integrate_upstream, integrate_upstream_commits, list_commit_files, list_virtual_branches, list_virtual_branches_cached, move_commit, move_commit_file, - push_base_branch, push_virtual_branch, reorder_stack, reset_files, reset_virtual_branch, + push_base_branch, reorder_stack, reset_files, reset_virtual_branch, resolve_upstream_integration, save_and_unapply_virutal_branch, set_base_branch, set_target_push_remote, squash, unapply_lines, unapply_ownership, unapply_without_saving_virtual_branch, undo_commit, update_branch_order, update_commit_message, diff --git a/crates/gitbutler-branch-actions/src/virtual.rs b/crates/gitbutler-branch-actions/src/virtual.rs index 859c47cdc0..4f81f5db34 100644 --- a/crates/gitbutler-branch-actions/src/virtual.rs +++ b/crates/gitbutler-branch-actions/src/virtual.rs @@ -5,16 +5,15 @@ use crate::{ file::VirtualBranchFile, hunk::VirtualBranchHunk, integration::get_workspace_head, - remote::branch_to_remote_branch, stack::stack_series, status::{get_applied_status, get_applied_status_cached}, - Get, RemoteBranchData, VirtualBranchHunkRange, VirtualBranchHunkRangeMap, VirtualBranchesExt, + Get, VirtualBranchHunkRange, VirtualBranchHunkRangeMap, VirtualBranchesExt, }; use anyhow::{anyhow, bail, Context, Result}; use bstr::{BString, ByteSlice}; use git2_hooks::HookResult; +use gitbutler_branch::dedup; use gitbutler_branch::BranchUpdateRequest; -use gitbutler_branch::{dedup, dedup_fmt}; use gitbutler_cherry_pick::RepositoryExt as _; use gitbutler_command_context::CommandContext; use gitbutler_commit::{commit_ext::CommitExt, commit_headers::HasCommitHeaders}; @@ -62,8 +61,6 @@ pub struct VirtualBranch { pub requires_force: bool, // does this branch require a force push to the upstream? pub conflicted: bool, // is this branch currently in a conflicted state (only for the workspace) pub order: usize, // the order in which this branch should be displayed in the UI - pub upstream: Option, // the upstream branch where this branch pushes to, if any - pub upstream_name: Option, // the upstream branch where this branch will push to on next push pub base_current: bool, // is this vbranch based on the current base branch? if false, this needs to be manually merged with conflicts /// The hunks (as `[(file, [hunks])]`) which are uncommitted but assigned to this branch. /// This makes them committable. @@ -350,11 +347,6 @@ pub fn list_virtual_branches_cached( for (mut branch, mut files) in status.branches { update_conflict_markers(ctx, files.clone())?; - let upstream_branch = match &branch.upstream { - Some(upstream) => repo.maybe_find_branch_by_refname(&Refname::from(upstream))?, - None => None, - }; - // find all commits on head that are not on target.sha let commits = repo.log(branch.head(), LogUntil::Commit(default_target.sha), false)?; let mut check_commit = @@ -370,12 +362,6 @@ pub fn list_virtual_branches_cached( let merge_base = gix_to_git2_oid(merge_base); let base_current = true; - let raw_remotes = repo.remotes()?; - let remotes: Vec<_> = raw_remotes.into_iter().flatten().collect(); - let upstream = upstream_branch - .map(|upstream_branch| branch_to_remote_branch(ctx, &upstream_branch, &remotes)) - .transpose()?; - let path_claim_positions: HashMap<&PathBuf, usize> = branch .ownership .claims @@ -429,10 +415,6 @@ pub fn list_virtual_branches_cached( files, order: branch.order, requires_force, - upstream, - upstream_name: branch - .upstream - .and_then(|r| Refname::from(r).branch().map(Into::into)), conflicted: conflicts::is_resolving(ctx), base_current, ownership: branch.ownership, @@ -859,64 +841,6 @@ pub fn commit( Ok(commit_oid) } -pub(crate) fn push( - ctx: &CommandContext, - stack_id: StackId, - with_force: bool, - askpass: Option>, -) -> Result { - let vb_state = ctx.project().virtual_branches(); - - let default_target = vb_state.get_default_target()?; - let upstream_remote = match default_target.push_remote_name { - Some(remote) => remote.clone(), - None => default_target.branch.remote().to_owned(), - }; - - let mut stack = vb_state.get_stack_in_workspace(stack_id)?; - let remote_branch = if let Some(upstream_branch) = &stack.upstream { - upstream_branch.clone() - } else { - let remote_branch = format!( - "refs/remotes/{}/{}", - upstream_remote, - normalize_branch_name(&stack.name)? - ) - .parse::() - .context("failed to parse remote branch name")?; - - let remote_branches = ctx.repo().remote_branches()?; - let existing_branches = remote_branches - .iter() - .map(RemoteRefname::branch) - .map(str::to_lowercase) // git is weird about case sensitivity here, assume not case sensitive - .collect::>(); - - remote_branch.with_branch(&dedup_fmt( - &existing_branches - .iter() - .map(String::as_str) - .collect::>(), - remote_branch.branch(), - "-", - )) - }; - - ctx.push(stack.head(), &remote_branch, with_force, None, askpass)?; - - stack.upstream = Some(remote_branch.clone()); - stack.upstream_head = Some(stack.head()); - vb_state - .set_stack(stack.clone()) - .context("failed to write target branch after push")?; - ctx.fetch(remote_branch.remote(), askpass.map(|_| "modal".to_string()))?; - - Ok(PushResult { - remote: upstream_remote, - refname: gitbutler_reference::Refname::Remote(remote_branch), - }) -} - type MergeBaseCommitGraph<'repo, 'cache> = gix::revwalk::Graph< 'repo, 'cache, @@ -1657,11 +1581,14 @@ pub(crate) fn update_commit_message( bail!("commit {commit_id} not in the branch"); } - let pushed_commit_oids = stack.upstream_head.map_or_else( + let pushed_commit_oids = stack.branches().first().map_or_else( || Ok(vec![]), - |upstream_head| { - ctx.repo() - .l(upstream_head, LogUntil::Commit(default_target.sha), false) + |branch| { + ctx.repo().l( + branch.remote_reference(stack.refname()), + LogUntil::Commit(default_target.sha), + false, + ) }, )?; diff --git a/crates/gitbutler-branch-actions/tests/virtual_branches/amend.rs b/crates/gitbutler-branch-actions/tests/virtual_branches/amend.rs index 674c08078e..ae9c0372d3 100644 --- a/crates/gitbutler-branch-actions/tests/virtual_branches/amend.rs +++ b/crates/gitbutler-branch-actions/tests/virtual_branches/amend.rs @@ -44,7 +44,7 @@ fn forcepush_allowed() -> anyhow::Result<()> { gitbutler_branch_actions::create_commit(project, branch_id, "commit one", None, false) .unwrap(); - gitbutler_branch_actions::push_virtual_branch(project, branch_id, false, None).unwrap(); + gitbutler_branch_actions::stack::push_stack(project, branch_id, false).unwrap(); { // amend another hunk @@ -103,7 +103,7 @@ fn forcepush_forbidden() { gitbutler_branch_actions::create_commit(project, branch_id, "commit one", None, false) .unwrap(); - gitbutler_branch_actions::push_virtual_branch(project, branch_id, false, None).unwrap(); + gitbutler_branch_actions::stack::push_stack(project, branch_id, false).unwrap(); { fs::write(repository.path().join("file2.txt"), "content2").unwrap(); diff --git a/crates/gitbutler-branch-actions/tests/virtual_branches/create_virtual_branch_from_branch.rs b/crates/gitbutler-branch-actions/tests/virtual_branches/create_virtual_branch_from_branch.rs index 33594ca4aa..a8e231d196 100644 --- a/crates/gitbutler-branch-actions/tests/virtual_branches/create_virtual_branch_from_branch.rs +++ b/crates/gitbutler-branch-actions/tests/virtual_branches/create_virtual_branch_from_branch.rs @@ -28,7 +28,7 @@ fn integration() { std::fs::write(repository.path().join("file.txt"), "first\n").unwrap(); gitbutler_branch_actions::create_commit(project, branch_id, "first", None, false).unwrap(); - gitbutler_branch_actions::push_virtual_branch(project, branch_id, false, None).unwrap(); + gitbutler_branch_actions::stack::push_stack(project, branch_id, false).unwrap(); let branch = gitbutler_branch_actions::list_virtual_branches(project) .unwrap() @@ -37,7 +37,7 @@ fn integration() { .find(|branch| branch.id == branch_id) .unwrap(); - let name = branch.upstream.unwrap().name; + let name = branch.series[0].as_ref().unwrap().name.parse().unwrap(); gitbutler_branch_actions::unapply_without_saving_virtual_branch(project, branch_id) .unwrap(); @@ -72,7 +72,7 @@ fn integration() { { // merge branch into master - gitbutler_branch_actions::push_virtual_branch(project, branch_id, false, None).unwrap(); + gitbutler_branch_actions::stack::push_stack(project, branch_id, false).unwrap(); let branch = gitbutler_branch_actions::list_virtual_branches(project) .unwrap() @@ -210,7 +210,6 @@ fn conflicts_with_uncommited() { .unwrap(); assert_eq!(new_branch_id, new_branch.id); assert_eq!(new_branch.series[0].clone().unwrap().patches.len(), 1); - assert!(new_branch.upstream.is_some()); } #[test] @@ -266,7 +265,6 @@ fn conflicts_with_commited() { .unwrap(); assert_eq!(new_branch_id, new_branch.id); assert_eq!(new_branch.series[0].clone().unwrap().patches.len(), 1); - assert!(new_branch.upstream.is_some()); } #[test] diff --git a/crates/gitbutler-branch-actions/tests/virtual_branches/init.rs b/crates/gitbutler-branch-actions/tests/virtual_branches/init.rs index 7e403b5286..16902813b2 100644 --- a/crates/gitbutler-branch-actions/tests/virtual_branches/init.rs +++ b/crates/gitbutler-branch-actions/tests/virtual_branches/init.rs @@ -65,7 +65,6 @@ fn dirty_non_target() { assert_eq!(branches.len(), 1); assert_eq!(branches[0].files.len(), 1); assert_eq!(branches[0].files[0].hunks.len(), 1); - assert!(branches[0].upstream.is_none()); assert_eq!(branches[0].name, "some-feature"); } @@ -92,7 +91,6 @@ fn dirty_target() { assert_eq!(branches.len(), 1); assert_eq!(branches[0].files.len(), 1); assert_eq!(branches[0].files[0].hunks.len(), 1); - assert!(branches[0].upstream.is_none()); assert_eq!(branches[0].name, "master"); } @@ -119,7 +117,6 @@ fn commit_on_non_target_local() { assert_eq!(branches.len(), 1); assert!(branches[0].files.is_empty()); assert_eq!(branches[0].series[0].clone().unwrap().patches.len(), 1); - assert!(branches[0].upstream.is_none()); assert_eq!(branches[0].name, "some-feature"); } @@ -147,7 +144,6 @@ fn commit_on_non_target_remote() { assert_eq!(branches.len(), 1); assert!(branches[0].files.is_empty()); assert_eq!(branches[0].series[0].clone().unwrap().patches.len(), 1); - assert!(branches[0].upstream.is_some()); assert_eq!(branches[0].name, "some-feature"); } @@ -173,7 +169,6 @@ fn commit_on_target() { assert_eq!(branches.len(), 1); assert!(branches[0].files.is_empty()); assert_eq!(branches[0].series[0].clone().unwrap().patches.len(), 1); - assert!(branches[0].upstream.is_none()); assert_eq!(branches[0].name, "master"); } diff --git a/crates/gitbutler-branch-actions/tests/virtual_branches/references.rs b/crates/gitbutler-branch-actions/tests/virtual_branches/references.rs index eed69b5118..c56e7470a2 100644 --- a/crates/gitbutler-branch-actions/tests/virtual_branches/references.rs +++ b/crates/gitbutler-branch-actions/tests/virtual_branches/references.rs @@ -237,7 +237,7 @@ mod push_virtual_branch { fs::write(repository.path().join("file.txt"), "content").unwrap(); gitbutler_branch_actions::create_commit(project, branch1_id, "test", None, false).unwrap(); - gitbutler_branch_actions::push_virtual_branch(project, branch1_id, false, None).unwrap(); + gitbutler_branch_actions::stack::push_stack(project, branch1_id, false).unwrap(); let list_result = gitbutler_branch_actions::list_virtual_branches(project).unwrap(); let branches = list_result.branches; @@ -245,7 +245,7 @@ mod push_virtual_branch { assert_eq!(branches[0].id, branch1_id); assert_eq!(branches[0].name, "name"); assert_eq!( - branches[0].upstream.as_ref().unwrap().name.to_string(), + branches[0].series[0].clone().unwrap().name, "refs/remotes/origin/name" ); @@ -254,7 +254,7 @@ mod push_virtual_branch { .into_iter() .filter_map(|reference| reference.name().map(|name| name.to_string())) .collect::>(); - assert!(refnames.contains(&branches[0].upstream.clone().unwrap().name.to_string())); + assert!(refnames.contains(&branches[0].series[0].clone().unwrap().name)); } #[test] @@ -285,8 +285,7 @@ mod push_virtual_branch { fs::write(repository.path().join("file.txt"), "content").unwrap(); gitbutler_branch_actions::create_commit(project, branch1_id, "test", None, false) .unwrap(); - gitbutler_branch_actions::push_virtual_branch(project, branch1_id, false, None) - .unwrap(); + gitbutler_branch_actions::stack::push_stack(project, branch1_id, false).unwrap(); branch1_id }; @@ -314,8 +313,7 @@ mod push_virtual_branch { fs::write(repository.path().join("file.txt"), "updated content").unwrap(); gitbutler_branch_actions::create_commit(project, branch2_id, "test", None, false) .unwrap(); - gitbutler_branch_actions::push_virtual_branch(project, branch2_id, false, None) - .unwrap(); + gitbutler_branch_actions::stack::push_stack(project, branch2_id, false).unwrap(); branch2_id }; @@ -326,15 +324,15 @@ mod push_virtual_branch { assert_eq!(branches[0].id, branch1_id); assert_eq!(branches[0].name, "updated name"); assert_eq!( - branches[0].upstream.as_ref().unwrap().name, - "refs/remotes/origin/name".parse().unwrap() + branches[0].series[0].clone().unwrap().name, + "refs/remotes/origin/name" ); // new branch is pushing to new ref remotely assert_eq!(branches[1].id, branch2_id); assert_eq!(branches[1].name, "name"); assert_eq!( - branches[1].upstream.as_ref().unwrap().name, - "refs/remotes/origin/name-1".parse().unwrap() + branches[1].series[0].clone().unwrap().name, + "refs/remotes/origin/name-1" ); let refnames = repository @@ -342,7 +340,7 @@ mod push_virtual_branch { .into_iter() .filter_map(|reference| reference.name().map(|name| name.to_string())) .collect::>(); - assert!(refnames.contains(&branches[0].upstream.clone().unwrap().name.to_string())); - assert!(refnames.contains(&branches[1].upstream.clone().unwrap().name.to_string())); + assert!(refnames.contains(&branches[0].series[0].clone().unwrap().name)); + assert!(refnames.contains(&branches[1].series[0].clone().unwrap().name)); } } diff --git a/crates/gitbutler-branch-actions/tests/virtual_branches/squash.rs b/crates/gitbutler-branch-actions/tests/virtual_branches/squash.rs index 1053edced4..f76e2b2599 100644 --- a/crates/gitbutler-branch-actions/tests/virtual_branches/squash.rs +++ b/crates/gitbutler-branch-actions/tests/virtual_branches/squash.rs @@ -163,7 +163,7 @@ fn forcepush_allowed() { .unwrap() }; - gitbutler_branch_actions::push_virtual_branch(project, branch_id, false, None).unwrap(); + gitbutler_branch_actions::stack::push_stack(project, branch_id, false).unwrap(); let commit_two_oid = { fs::write(repository.path().join("file two.txt"), "").unwrap(); @@ -240,7 +240,7 @@ fn forcepush_forbidden() { .unwrap() }; - gitbutler_branch_actions::push_virtual_branch(project, branch_id, false, None).unwrap(); + gitbutler_branch_actions::stack::push_stack(project, branch_id, false).unwrap(); let commit_two_oid = { fs::write(repository.path().join("file two.txt"), "").unwrap(); diff --git a/crates/gitbutler-branch-actions/tests/virtual_branches/update_commit_message.rs b/crates/gitbutler-branch-actions/tests/virtual_branches/update_commit_message.rs index 39e8dc0b85..8b0abca673 100644 --- a/crates/gitbutler-branch-actions/tests/virtual_branches/update_commit_message.rs +++ b/crates/gitbutler-branch-actions/tests/virtual_branches/update_commit_message.rs @@ -174,7 +174,7 @@ fn forcepush_allowed() { .unwrap() }; - gitbutler_branch_actions::push_virtual_branch(project, branch_id, false, None).unwrap(); + gitbutler_branch_actions::stack::push_stack(project, branch_id, false).unwrap(); gitbutler_branch_actions::update_commit_message( project, @@ -236,7 +236,7 @@ fn forcepush_forbidden() { .unwrap() }; - gitbutler_branch_actions::push_virtual_branch(project, branch_id, false, None).unwrap(); + gitbutler_branch_actions::stack::push_stack(project, branch_id, false).unwrap(); assert_eq!( gitbutler_branch_actions::update_commit_message( diff --git a/crates/gitbutler-branch-actions/tests/virtual_branches/upstream.rs b/crates/gitbutler-branch-actions/tests/virtual_branches/upstream.rs index 162dfdb3df..bc758f5b34 100644 --- a/crates/gitbutler-branch-actions/tests/virtual_branches/upstream.rs +++ b/crates/gitbutler-branch-actions/tests/virtual_branches/upstream.rs @@ -88,7 +88,7 @@ fn detect_integrated_commits() { }; // push - gitbutler_branch_actions::push_virtual_branch(project, branch1_id, false, None).unwrap(); + gitbutler_branch_actions::stack::push_stack(project, branch1_id, false).unwrap(); { // merge branch upstream @@ -99,7 +99,15 @@ fn detect_integrated_commits() { .find(|b| b.id == branch1_id) .unwrap(); repository - .merge(&branch.upstream.as_ref().unwrap().name) + .merge( + &branch.series[0] + .clone() + .unwrap() + .upstream_reference + .unwrap() + .parse() + .unwrap(), + ) .unwrap(); repository.fetch(); } diff --git a/crates/gitbutler-tauri/src/app.rs b/crates/gitbutler-tauri/src/app.rs index d0f8533016..188ff31f69 100644 --- a/crates/gitbutler-tauri/src/app.rs +++ b/crates/gitbutler-tauri/src/app.rs @@ -5,8 +5,6 @@ use gitbutler_branch_actions::conflicts; use gitbutler_command_context::CommandContext; use gitbutler_project as projects; use gitbutler_project::ProjectId; -use gitbutler_reference::RemoteRefname; -use gitbutler_repo::RepositoryExt; use gitbutler_repo_actions::RepoActionsExt; use gitbutler_stack::StackId; @@ -35,10 +33,13 @@ impl App { Ok(()) } - pub fn git_remote_branches(&self, project_id: ProjectId) -> Result> { + pub fn git_remote_branches(&self, project_id: ProjectId) -> Result> { let project = self.projects().get(project_id)?; let ctx = CommandContext::open(&project)?; - ctx.repo().remote_branches() + let branches = ctx.repo().branches(Some(git2::BranchType::Remote))?; + Ok(branches + .filter_map(|branch| Some(branch.ok()?.0.name().ok()??.to_string())) + .collect::>()) } pub fn git_test_push( diff --git a/crates/gitbutler-tauri/src/commands.rs b/crates/gitbutler-tauri/src/commands.rs index 80547d3eae..d8d5aebe86 100644 --- a/crates/gitbutler-tauri/src/commands.rs +++ b/crates/gitbutler-tauri/src/commands.rs @@ -1,5 +1,4 @@ use gitbutler_project::ProjectId; -use gitbutler_reference::RemoteRefname; use tauri::State; use tracing::instrument; @@ -10,7 +9,7 @@ use crate::{error::Error, App}; pub fn git_remote_branches( app: State<'_, App>, project_id: ProjectId, -) -> Result, Error> { +) -> Result, Error> { Ok(app.git_remote_branches(project_id)?) } diff --git a/crates/gitbutler-tauri/src/main.rs b/crates/gitbutler-tauri/src/main.rs index 3042b38098..83426b1088 100644 --- a/crates/gitbutler-tauri/src/main.rs +++ b/crates/gitbutler-tauri/src/main.rs @@ -176,7 +176,6 @@ fn main() { virtual_branches::commands::unapply_lines, virtual_branches::commands::unapply_ownership, virtual_branches::commands::reset_files, - virtual_branches::commands::push_virtual_branch, virtual_branches::commands::create_virtual_branch_from_branch, virtual_branches::commands::can_apply_remote_branch, virtual_branches::commands::list_commit_files, diff --git a/crates/gitbutler-tauri/src/virtual_branches.rs b/crates/gitbutler-tauri/src/virtual_branches.rs index efb7b428b6..d5fb594be4 100644 --- a/crates/gitbutler-tauri/src/virtual_branches.rs +++ b/crates/gitbutler-tauri/src/virtual_branches.rs @@ -2,7 +2,7 @@ pub mod commands { use anyhow::{anyhow, Context}; use gitbutler_branch::{BranchCreateRequest, BranchUpdateRequest}; use gitbutler_branch_actions::branch_upstream_integration::IntegrationStrategy; - use gitbutler_branch_actions::internal::{PushResult, StackListResult}; + use gitbutler_branch_actions::internal::StackListResult; use gitbutler_branch_actions::upstream_integration::{ BaseBranchResolution, BaseBranchResolutionApproach, Resolution, StackStatuses, }; @@ -292,26 +292,6 @@ pub mod commands { Ok(()) } - #[tauri::command(async)] - #[instrument(skip(projects, windows), err(Debug))] - pub fn push_virtual_branch( - windows: State<'_, WindowState>, - projects: State<'_, projects::Controller>, - project_id: ProjectId, - branch_id: StackId, - with_force: bool, - ) -> Result { - let project = projects.get(project_id)?; - let upstream_refname = gitbutler_branch_actions::push_virtual_branch( - &project, - branch_id, - with_force, - Some(Some(branch_id)), - )?; - emit_vbranches(&windows, project_id); - Ok(upstream_refname) - } - #[tauri::command(async)] #[instrument(skip(projects), err(Debug))] pub fn can_apply_remote_branch(