summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation/commit_files.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/presentation/commit_files.go')
-rw-r--r--pkg/gui/presentation/commit_files.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/pkg/gui/presentation/commit_files.go b/pkg/gui/presentation/commit_files.go
index 4980f6c50..94116066a 100644
--- a/pkg/gui/presentation/commit_files.go
+++ b/pkg/gui/presentation/commit_files.go
@@ -8,21 +8,16 @@ import (
"github.com/jesseduffield/lazygit/pkg/utils"
)
-func GetCommitFileLine(name string, diffName string, commitFile *models.CommitFile, patchManager *patch.PatchManager, parent string) string {
+func GetCommitFileLine(name string, diffName string, commitFile *models.CommitFile, status patch.PatchStatus) string {
yellow := color.New(color.FgYellow)
green := color.New(color.FgGreen)
defaultColor := color.New(theme.DefaultTextColor)
diffTerminalColor := color.New(theme.DiffTerminalColor)
- if commitFile == nil {
- return name
- }
-
colour := defaultColor
if diffName == name {
colour = diffTerminalColor
- } else if commitFile != nil {
- status := patchManager.GetFileStatus(commitFile.Name, parent)
+ } else {
switch status {
case patch.UNSELECTED:
colour = defaultColor
@@ -33,6 +28,10 @@ func GetCommitFileLine(name string, diffName string, commitFile *models.CommitFi
}
}
+ if commitFile == nil {
+ return colour.Sprint(name)
+ }
+
return utils.ColoredString(commitFile.ChangeStatus, getColorForChangeStatus(commitFile.ChangeStatus)) + " " + colour.Sprint(name)
}