Switch to status tab after merge / rebase with conflicts (#932)

This commit is contained in:
Alessandro Menezes 2021-10-07 03:33:30 -04:00 committed by GitHub
parent c6abbaf4d4
commit d84120a895
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View file

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Added
- support rebasing branches with conflicts ([#895](https://github.com/extrawurst/gitui/issues/895))
- switch to status tab after merging or rebasing with conflicts ([#926](https://github.com/extrawurst/gitui/issues/926))
## Fixed
- fix supported checkout of hierarchical branchnames ([#921](https://github.com/extrawurst/gitui/issues/921))

View file

@ -19,6 +19,7 @@ use asyncgit::{
RemoteBranch,
},
checkout_branch, get_branches_info, BranchInfo, CommitId,
RepoState,
},
AsyncGitNotification, CWD,
};
@ -368,8 +369,7 @@ impl BranchListComponent {
{
sync::merge_branch(CWD, &branch.name)?;
self.hide();
self.queue.push(InternalEvent::Update(NeedsUpdate::ALL));
self.hide_and_switch_tab()?;
}
Ok(())
@ -381,9 +381,18 @@ impl BranchListComponent {
{
sync::rebase_branch(CWD, &branch.name)?;
self.hide();
self.hide_and_switch_tab()?;
}
self.queue.push(InternalEvent::Update(NeedsUpdate::ALL));
Ok(())
}
fn hide_and_switch_tab(&mut self) -> Result<()> {
self.hide();
self.queue.push(InternalEvent::Update(NeedsUpdate::ALL));
if sync::repo_state(CWD)? != RepoState::Clean {
self.queue.push(InternalEvent::TabSwitch);
}
Ok(())