2% optimisation in revlog where amend was still run on each event

This commit is contained in:
Stephan Dilly 2020-06-25 18:35:16 +02:00
parent b3b7f37756
commit df338334e1
2 changed files with 13 additions and 10 deletions

View File

@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- clearer help headers ([#131](https://github.com/extrawurst/gitui/issues/131))
- diisplay non-utf8 commit messages at least partially ([#150](https://github.com/extrawurst/gitui/issues/150))
- hooks ignored when running `gitui` in subfolder of workdir ([#151](https://github.com/extrawurst/gitui/issues/151))
- some optimizations in reflog
## [0.7.0] - 2020-06-15

View File

@ -44,17 +44,19 @@ impl Component for CommitComponent {
) -> CommandBlocking {
self.input.commands(out, force_all);
out.push(CommandInfo::new(
commands::COMMIT_ENTER,
self.can_commit(),
self.is_visible() || force_all,
));
if self.is_visible() || force_all {
out.push(CommandInfo::new(
commands::COMMIT_ENTER,
self.can_commit(),
true,
));
out.push(CommandInfo::new(
commands::COMMIT_AMEND,
self.can_amend(),
self.is_visible() || force_all,
));
out.push(CommandInfo::new(
commands::COMMIT_AMEND,
self.can_amend(),
true,
));
}
visibility_blocking(self)
}