diff --git a/CHANGELOG.md b/CHANGELOG.md index 885a11b06f..f2e7297829 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/src/components/branchlist.rs b/src/components/branchlist.rs index e092b952b2..7360268ec5 100644 --- a/src/components/branchlist.rs +++ b/src/components/branchlist.rs @@ -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()?; + } + + Ok(()) + } + + fn hide_and_switch_tab(&mut self) -> Result<()> { + self.hide(); + self.queue.push(InternalEvent::Update(NeedsUpdate::ALL)); - self.queue.push(InternalEvent::Update(NeedsUpdate::ALL)); + if sync::repo_state(CWD)? != RepoState::Clean { + self.queue.push(InternalEvent::TabSwitch); } Ok(())