mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-27 22:38:09 +02:00
Cleanup: use nil for empty slice
This commit is contained in:
@@ -214,7 +214,7 @@ func (self *CommitLoader) extractCommitFromLine(hashPool *utils.StringPool, line
|
|||||||
}
|
}
|
||||||
message := split[7]
|
message := split[7]
|
||||||
|
|
||||||
tags := []string{}
|
var tags []string
|
||||||
|
|
||||||
if extraInfo != "" {
|
if extraInfo != "" {
|
||||||
extraInfoFields := strings.Split(extraInfo, ",")
|
extraInfoFields := strings.Split(extraInfo, ",")
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ func TestGetCommits(t *testing.T) {
|
|||||||
Name: "better typing for rebase mode",
|
Name: "better typing for rebase mode",
|
||||||
Status: models.StatusUnpushed,
|
Status: models.StatusUnpushed,
|
||||||
Action: models.ActionNone,
|
Action: models.ActionNone,
|
||||||
Tags: []string{},
|
Tags: nil,
|
||||||
ExtraInfo: "(HEAD -> better-tests)",
|
ExtraInfo: "(HEAD -> better-tests)",
|
||||||
AuthorName: "Jesse Duffield",
|
AuthorName: "Jesse Duffield",
|
||||||
AuthorEmail: "jessedduffield@gmail.com",
|
AuthorEmail: "jessedduffield@gmail.com",
|
||||||
@@ -100,7 +100,7 @@ func TestGetCommits(t *testing.T) {
|
|||||||
Name: "fix logging",
|
Name: "fix logging",
|
||||||
Status: models.StatusPushed,
|
Status: models.StatusPushed,
|
||||||
Action: models.ActionNone,
|
Action: models.ActionNone,
|
||||||
Tags: []string{},
|
Tags: nil,
|
||||||
ExtraInfo: "(origin/better-tests)",
|
ExtraInfo: "(origin/better-tests)",
|
||||||
AuthorName: "Jesse Duffield",
|
AuthorName: "Jesse Duffield",
|
||||||
AuthorEmail: "jessedduffield@gmail.com",
|
AuthorEmail: "jessedduffield@gmail.com",
|
||||||
@@ -128,7 +128,7 @@ func TestGetCommits(t *testing.T) {
|
|||||||
Name: "WIP",
|
Name: "WIP",
|
||||||
Status: models.StatusPushed,
|
Status: models.StatusPushed,
|
||||||
Action: models.ActionNone,
|
Action: models.ActionNone,
|
||||||
Tags: []string{},
|
Tags: nil,
|
||||||
ExtraInfo: "",
|
ExtraInfo: "",
|
||||||
AuthorName: "Jesse Duffield",
|
AuthorName: "Jesse Duffield",
|
||||||
AuthorEmail: "jessedduffield@gmail.com",
|
AuthorEmail: "jessedduffield@gmail.com",
|
||||||
@@ -142,7 +142,7 @@ func TestGetCommits(t *testing.T) {
|
|||||||
Name: "WIP",
|
Name: "WIP",
|
||||||
Status: models.StatusPushed,
|
Status: models.StatusPushed,
|
||||||
Action: models.ActionNone,
|
Action: models.ActionNone,
|
||||||
Tags: []string{},
|
Tags: nil,
|
||||||
ExtraInfo: "",
|
ExtraInfo: "",
|
||||||
AuthorName: "Jesse Duffield",
|
AuthorName: "Jesse Duffield",
|
||||||
AuthorEmail: "jessedduffield@gmail.com",
|
AuthorEmail: "jessedduffield@gmail.com",
|
||||||
@@ -156,7 +156,7 @@ func TestGetCommits(t *testing.T) {
|
|||||||
Name: "WIP",
|
Name: "WIP",
|
||||||
Status: models.StatusMerged,
|
Status: models.StatusMerged,
|
||||||
Action: models.ActionNone,
|
Action: models.ActionNone,
|
||||||
Tags: []string{},
|
Tags: nil,
|
||||||
ExtraInfo: "",
|
ExtraInfo: "",
|
||||||
AuthorName: "Jesse Duffield",
|
AuthorName: "Jesse Duffield",
|
||||||
AuthorEmail: "jessedduffield@gmail.com",
|
AuthorEmail: "jessedduffield@gmail.com",
|
||||||
@@ -170,7 +170,7 @@ func TestGetCommits(t *testing.T) {
|
|||||||
Name: "WIP",
|
Name: "WIP",
|
||||||
Status: models.StatusMerged,
|
Status: models.StatusMerged,
|
||||||
Action: models.ActionNone,
|
Action: models.ActionNone,
|
||||||
Tags: []string{},
|
Tags: nil,
|
||||||
ExtraInfo: "",
|
ExtraInfo: "",
|
||||||
AuthorName: "Jesse Duffield",
|
AuthorName: "Jesse Duffield",
|
||||||
AuthorEmail: "jessedduffield@gmail.com",
|
AuthorEmail: "jessedduffield@gmail.com",
|
||||||
@@ -184,7 +184,7 @@ func TestGetCommits(t *testing.T) {
|
|||||||
Name: "refactoring the config struct",
|
Name: "refactoring the config struct",
|
||||||
Status: models.StatusMerged,
|
Status: models.StatusMerged,
|
||||||
Action: models.ActionNone,
|
Action: models.ActionNone,
|
||||||
Tags: []string{},
|
Tags: nil,
|
||||||
ExtraInfo: "",
|
ExtraInfo: "",
|
||||||
AuthorName: "Jesse Duffield",
|
AuthorName: "Jesse Duffield",
|
||||||
AuthorEmail: "jessedduffield@gmail.com",
|
AuthorEmail: "jessedduffield@gmail.com",
|
||||||
@@ -220,7 +220,7 @@ func TestGetCommits(t *testing.T) {
|
|||||||
Name: "better typing for rebase mode",
|
Name: "better typing for rebase mode",
|
||||||
Status: models.StatusUnpushed,
|
Status: models.StatusUnpushed,
|
||||||
Action: models.ActionNone,
|
Action: models.ActionNone,
|
||||||
Tags: []string{},
|
Tags: nil,
|
||||||
ExtraInfo: "(HEAD -> better-tests)",
|
ExtraInfo: "(HEAD -> better-tests)",
|
||||||
AuthorName: "Jesse Duffield",
|
AuthorName: "Jesse Duffield",
|
||||||
AuthorEmail: "jessedduffield@gmail.com",
|
AuthorEmail: "jessedduffield@gmail.com",
|
||||||
@@ -258,7 +258,7 @@ func TestGetCommits(t *testing.T) {
|
|||||||
Name: "better typing for rebase mode",
|
Name: "better typing for rebase mode",
|
||||||
Status: models.StatusUnpushed,
|
Status: models.StatusUnpushed,
|
||||||
Action: models.ActionNone,
|
Action: models.ActionNone,
|
||||||
Tags: []string{},
|
Tags: nil,
|
||||||
ExtraInfo: "(HEAD -> better-tests)",
|
ExtraInfo: "(HEAD -> better-tests)",
|
||||||
AuthorName: "Jesse Duffield",
|
AuthorName: "Jesse Duffield",
|
||||||
AuthorEmail: "jessedduffield@gmail.com",
|
AuthorEmail: "jessedduffield@gmail.com",
|
||||||
|
|||||||
Reference in New Issue
Block a user