Skip to content

Commit d84120a

Browse files
Switch to status tab after merge / rebase with conflicts (#932)
1 parent c6abbaf commit d84120a

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## Added
1111
- support rebasing branches with conflicts ([#895](https://github.com/extrawurst/gitui/issues/895))
12+
- switch to status tab after merging or rebasing with conflicts ([#926](https://github.com/extrawurst/gitui/issues/926))
1213

1314
## Fixed
1415
- fix supported checkout of hierarchical branchnames ([#921](https://github.com/extrawurst/gitui/issues/921))

Diff for: src/components/branchlist.rs

+13-4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use asyncgit::{
1919
RemoteBranch,
2020
},
2121
checkout_branch, get_branches_info, BranchInfo, CommitId,
22+
RepoState,
2223
},
2324
AsyncGitNotification, CWD,
2425
};
@@ -368,8 +369,7 @@ impl BranchListComponent {
368369
{
369370
sync::merge_branch(CWD, &branch.name)?;
370371

371-
self.hide();
372-
self.queue.push(InternalEvent::Update(NeedsUpdate::ALL));
372+
self.hide_and_switch_tab()?;
373373
}
374374

375375
Ok(())
@@ -381,9 +381,18 @@ impl BranchListComponent {
381381
{
382382
sync::rebase_branch(CWD, &branch.name)?;
383383

384-
self.hide();
384+
self.hide_and_switch_tab()?;
385+
}
386+
387+
Ok(())
388+
}
389+
390+
fn hide_and_switch_tab(&mut self) -> Result<()> {
391+
self.hide();
392+
self.queue.push(InternalEvent::Update(NeedsUpdate::ALL));
385393

386-
self.queue.push(InternalEvent::Update(NeedsUpdate::ALL));
394+
if sync::repo_state(CWD)? != RepoState::Clean {
395+
self.queue.push(InternalEvent::TabSwitch);
387396
}
388397

389398
Ok(())

0 commit comments

Comments
 (0)