diff --git a/crates/gitbutler-branch-actions/src/actions.rs b/crates/gitbutler-branch-actions/src/actions.rs index 4809a5cfc..fdf017950 100644 --- a/crates/gitbutler-branch-actions/src/actions.rs +++ b/crates/gitbutler-branch-actions/src/actions.rs @@ -413,7 +413,7 @@ pub fn push_virtual_branch( branch_id: BranchId, with_force: bool, askpass: Option>, -) -> Result<()> { +) -> Result { let ctx = open_with_verify(project)?; assure_open_workspace_mode(&ctx).context("Pushing a branch requires open workspace mode")?; vbranch::push(&ctx, branch_id, with_force, askpass) diff --git a/crates/gitbutler-branch-actions/src/virtual.rs b/crates/gitbutler-branch-actions/src/virtual.rs index 9da9d77ca..6620701b7 100644 --- a/crates/gitbutler-branch-actions/src/virtual.rs +++ b/crates/gitbutler-branch-actions/src/virtual.rs @@ -1045,7 +1045,7 @@ pub(crate) fn push( branch_id: BranchId, with_force: bool, askpass: Option>, -) -> Result<()> { +) -> Result { let vb_state = ctx.project().virtual_branches(); let mut vbranch = vb_state.get_branch_in_workspace(branch_id)?; @@ -1092,7 +1092,7 @@ pub(crate) fn push( .context("failed to write target branch after push")?; ctx.fetch(remote_branch.remote(), askpass.map(|_| "modal".to_string()))?; - Ok(()) + Ok(gitbutler_reference::Refname::Remote(remote_branch)) } struct IsCommitIntegrated<'repo> { diff --git a/crates/gitbutler-tauri/src/virtual_branches.rs b/crates/gitbutler-tauri/src/virtual_branches.rs index 115c2c40e..8dceb71f8 100644 --- a/crates/gitbutler-tauri/src/virtual_branches.rs +++ b/crates/gitbutler-tauri/src/virtual_branches.rs @@ -267,9 +267,9 @@ pub mod commands { project_id: ProjectId, branch_id: BranchId, with_force: bool, - ) -> Result<(), Error> { + ) -> Result { let project = projects.get(project_id)?; - gitbutler_branch_actions::push_virtual_branch( + let upstream_refname = gitbutler_branch_actions::push_virtual_branch( &project, branch_id, with_force, @@ -277,7 +277,7 @@ pub mod commands { ) .map_err(|err| err.context(Code::Unknown))?; emit_vbranches(&windows, project_id); - Ok(()) + Ok(upstream_refname) } #[tauri::command(async)]