1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Pass "now" into utils.Loader

This makes it possible to write deterministic tests for views that use it.
This commit is contained in:
Stefan Haller
2023-10-14 15:31:13 +02:00
parent 58a83b0862
commit 23befdd13a
5 changed files with 13 additions and 9 deletions

View File

@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"strings"
"time"
"github.com/jesseduffield/lazygit/pkg/commands/types/enums"
"github.com/jesseduffield/lazygit/pkg/constants"
@ -106,7 +107,7 @@ func (self *StatusController) onClick() error {
}
cx, _ := self.c.Views().Status.Cursor()
upstreamStatus := presentation.BranchStatus(currentBranch, types.ItemOperationNone, self.c.Tr)
upstreamStatus := presentation.BranchStatus(currentBranch, types.ItemOperationNone, self.c.Tr, time.Now())
repoName := self.c.Git().RepoPaths.RepoName()
workingTreeState := self.c.Git().Status.WorkingTreeState()
switch workingTreeState {