Skip to content

Commit

Permalink
Add logic for rebasing upstream content
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb-T-Owens committed Sep 3, 2024
1 parent 41e976e commit 4593aaa
Show file tree
Hide file tree
Showing 10 changed files with 759 additions and 549 deletions.
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/components/UpdateBaseButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@

<div class="action" class:action--centered={status.type === 'FullyIntegrated'}>
{#if status.type === 'FullyIntegrated'}
<p>Will be unapplied</p>
<p>Will be liberated</p>
{:else}
<Select
value="rebase"
options={[
{ label: 'Rebase', value: 'rebase' },
{ label: 'Merege', value: 'merge' },
{ label: 'Merge', value: 'merge' },
{ label: 'Stash', value: 'stash' }
]}
>
Expand Down
13 changes: 6 additions & 7 deletions crates/gitbutler-branch-actions/src/actions.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use super::r#virtual as branch;
use crate::base::upstream_integration::{
upstream_integration_statuses, BranchStatuses, UpstreamIntegrationStatusesContext,
};
use crate::branch::get_uncommited_files_raw;
use crate::upstream_integration::{
upstream_integration_statuses, BranchStatuses, UpstreamIntegrationContext,
};
use crate::{
base::{
get_base_branch_data, set_base_branch, set_target_push_remote, update_base_branch,
Expand Down Expand Up @@ -617,12 +617,11 @@ impl VirtualBranchActions {

pub fn upstream_integration_statuses(&self, project: &Project) -> Result<BranchStatuses> {
let command_context = CommandContext::open(project)?;
let guard = project.exclusive_worktree_access();
let mut guard = project.exclusive_worktree_access();

let context =
UpstreamIntegrationStatusesContext::open(&command_context, guard.read_permission())?;
let context = UpstreamIntegrationContext::open(&command_context, guard.write_permission())?;

upstream_integration_statuses(context)
upstream_integration_statuses(&context)
}
}

Expand Down
Loading

0 comments on commit 4593aaa

Please sign in to comment.