mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-24 13:37:34 +03:00
Merge pull request #5171 from gitbutlerapp/Fix-rebasers
Fix issue where incoming commit headers were caried into merge commit headers
This commit is contained in:
commit
e587ee3dde
@ -288,24 +288,19 @@ pub fn gitbutler_merge_commits<'repository>(
|
||||
tree_oid = merged_index.write_tree_to(repository)?;
|
||||
}
|
||||
|
||||
let commit_headers = incoming_commit
|
||||
.gitbutler_headers()
|
||||
.or_else(|| Some(Default::default()))
|
||||
.map(|commit_headers| {
|
||||
let conflicted_file_count = conflicted_files.total_entries() as u64;
|
||||
let conflicted_file_count = conflicted_files.total_entries() as u64;
|
||||
|
||||
if conflicted_file_count > 0 {
|
||||
CommitHeadersV2 {
|
||||
conflicted: Some(conflicted_file_count),
|
||||
..commit_headers
|
||||
}
|
||||
} else {
|
||||
CommitHeadersV2 {
|
||||
conflicted: None,
|
||||
..commit_headers
|
||||
}
|
||||
}
|
||||
});
|
||||
let commit_headers = if conflicted_file_count > 0 {
|
||||
CommitHeadersV2 {
|
||||
conflicted: Some(conflicted_file_count),
|
||||
..Default::default()
|
||||
}
|
||||
} else {
|
||||
CommitHeadersV2 {
|
||||
conflicted: None,
|
||||
..Default::default()
|
||||
}
|
||||
};
|
||||
|
||||
let (author, committer) = repository.signatures()?;
|
||||
|
||||
@ -322,7 +317,7 @@ pub fn gitbutler_merge_commits<'repository>(
|
||||
.find_tree(tree_oid)
|
||||
.context("failed to find tree")?,
|
||||
&[&target_commit, &incoming_commit],
|
||||
commit_headers,
|
||||
Some(commit_headers),
|
||||
)
|
||||
.context("failed to create commit")?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user