mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-10-26 13:12:25 +03:00
Use correct headers for unapplying wip commits
This commit is contained in:
parent
0408f5ec11
commit
49236707be
@ -3506,20 +3506,13 @@ pub fn create_virtual_branch_from_branch(
|
|||||||
{
|
{
|
||||||
let head_commit = repo.find_commit(branch.head)?;
|
let head_commit = repo.find_commit(branch.head)?;
|
||||||
|
|
||||||
if let Some(header) = head_commit.raw_header() {
|
if let Some(headers) = head_commit.gitbutler_headers() {
|
||||||
if header
|
if headers.is_unapplied_header_commit {
|
||||||
.lines()
|
if let Some(branch_name) = headers.vbranch_name {
|
||||||
.any(|line| line.starts_with("gitbutler-vbranch"))
|
|
||||||
{
|
|
||||||
if let Some(branch_name) = header
|
|
||||||
.lines()
|
|
||||||
.find(|line| line.starts_with("gitbutler-vbranch-name"))
|
|
||||||
.and_then(|line| line.split_once(' '))
|
|
||||||
.map(|(_, name)| name.to_string())
|
|
||||||
{
|
|
||||||
branch.name = branch_name;
|
branch.name = branch_name;
|
||||||
|
|
||||||
vb_state.set_branch(branch.clone())?;
|
vb_state.set_branch(branch.clone())?;
|
||||||
}
|
};
|
||||||
|
|
||||||
undo_commit(project_repository, branch_id, branch.head)?;
|
undo_commit(project_repository, branch_id, branch.head)?;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user