Skip to content

Commit e215e47

Browse files
committed
Use the right branch name when creating merge commit for integrating upstream
1 parent 842cfab commit e215e47

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

crates/gitbutler-branch-actions/src/upstream_integration.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::stack::branch_integrated;
22
use crate::{r#virtual::IsCommitIntegrated, BranchManagerExt, VirtualBranchesExt as _};
3-
use anyhow::{anyhow, bail, Result};
3+
use anyhow::{anyhow, bail, Context, Result};
44
use gitbutler_cherry_pick::RepositoryExt;
55
use gitbutler_command_context::CommandContext;
66
use gitbutler_commit::commit_ext::CommitExt as _;
@@ -561,13 +561,18 @@ fn compute_resolutions(
561561
// then rebase the tree ontop of that. If the tree ends
562562
// up conflicted, commit the tree.
563563
let target_commit = repository.find_commit(branch_stack.head())?;
564+
let top_branch = branch_stack.heads.last().context("top branch not found")?;
565+
566+
// These two go into the merge commit message.
567+
let incoming_branch_name = target.branch.fullname();
568+
let target_branch_name = &top_branch.name;
564569

565570
let new_head = gitbutler_merge_commits(
566571
repository,
567572
target_commit,
568573
new_target.clone(),
569-
&branch_stack.name,
570-
&target.branch.to_string(),
574+
target_branch_name,
575+
&incoming_branch_name,
571576
)?;
572577

573578
// Get the updated tree oid

0 commit comments

Comments
 (0)