mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Use an interface for tasks instead of a concrete struct
By using an interface for tasks we can use a fake implementation in tests with extra methods
This commit is contained in:
parent
8964cedf27
commit
6b9390409e
45 changed files with 333 additions and 222 deletions
|
@ -87,7 +87,7 @@ func (self *RefreshHelper) Refresh(options types.RefreshOptions) error {
|
|||
|
||||
refresh := func(f func()) {
|
||||
if options.Mode == types.ASYNC {
|
||||
self.c.OnWorker(func(t *gocui.Task) {
|
||||
self.c.OnWorker(func(t gocui.Task) {
|
||||
f()
|
||||
})
|
||||
} else {
|
||||
|
@ -201,7 +201,7 @@ func getModeName(mode types.RefreshMode) string {
|
|||
func (self *RefreshHelper) refreshReflogCommitsConsideringStartup() {
|
||||
switch self.c.State().GetRepoState().GetStartupStage() {
|
||||
case types.INITIAL:
|
||||
self.c.OnWorker(func(_ *gocui.Task) {
|
||||
self.c.OnWorker(func(_ gocui.Task) {
|
||||
_ = self.refreshReflogCommits()
|
||||
self.refreshBranches()
|
||||
self.c.State().GetRepoState().SetStartupStage(types.COMPLETE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue