summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/commit_loader_test.go
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-04-03 12:40:29 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-04-15 08:36:03 +0200
commit188773511e0c94a4ec338328865e824402ec8b00 (patch)
tree9c6c9b596c52d382c857071312743ff26ee70ae6 /pkg/commands/git_commands/commit_loader_test.go
parent62c5c32fbb0a44713933724e5c941ee1d42c2b27 (diff)
Store commit.Status as an enum instead of a string
This is unrelated to the changes in this PR, but since we are doing the same thing for the commit.Action field in the next commit, it makes sense to do it for Status too for consistency. Modelling this as an enum feels more natural than modelling it as a string, since there's a finite set of possible values. And it saves a little bit of memory (not very much, since none of the strings were heap-allocated, but still).
Diffstat (limited to 'pkg/commands/git_commands/commit_loader_test.go')
-rw-r--r--pkg/commands/git_commands/commit_loader_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/commands/git_commands/commit_loader_test.go b/pkg/commands/git_commands/commit_loader_test.go
index 8ba3e6649..dab321753 100644
--- a/pkg/commands/git_commands/commit_loader_test.go
+++ b/pkg/commands/git_commands/commit_loader_test.go
@@ -78,7 +78,7 @@ func TestGetCommits(t *testing.T) {
{
Sha: "0eea75e8c631fba6b58135697835d58ba4c18dbc",
Name: "better typing for rebase mode",
- Status: "unpushed",
+ Status: models.StatusUnpushed,
Action: "",
Tags: []string{},
ExtraInfo: "(HEAD -> better-tests)",
@@ -92,7 +92,7 @@ func TestGetCommits(t *testing.T) {
{
Sha: "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164",
Name: "fix logging",
- Status: "pushed",
+ Status: models.StatusPushed,
Action: "",
Tags: []string{},
ExtraInfo: "(origin/better-tests)",
@@ -106,7 +106,7 @@ func TestGetCommits(t *testing.T) {
{
Sha: "e94e8fc5b6fab4cb755f29f1bdb3ee5e001df35c",
Name: "refactor",
- Status: "pushed",
+ Status: models.StatusPushed,
Action: "",
Tags: []string{},
ExtraInfo: "",
@@ -120,7 +120,7 @@ func TestGetCommits(t *testing.T) {
{
Sha: "d8084cd558925eb7c9c38afeed5725c21653ab90",
Name: "WIP",
- Status: "pushed",
+ Status: models.StatusPushed,
Action: "",
Tags: []string{},
ExtraInfo: "",
@@ -134,7 +134,7 @@ func TestGetCommits(t *testing.T) {
{
Sha: "65f910ebd85283b5cce9bf67d03d3f1a9ea3813a",
Name: "WIP",
- Status: "pushed",
+ Status: models.StatusPushed,
Action: "",
Tags: []string{},
ExtraInfo: "",
@@ -148,7 +148,7 @@ func TestGetCommits(t *testing.T) {
{
Sha: "26c07b1ab33860a1a7591a0638f9925ccf497ffa",
Name: "WIP",
- Status: "merged",
+ Status: models.StatusMerged,
Action: "",
Tags: []string{},
ExtraInfo: "",
@@ -162,7 +162,7 @@ func TestGetCommits(t *testing.T) {
{
Sha: "3d4470a6c072208722e5ae9a54bcb9634959a1c5",
Name: "WIP",
- Status: "merged",
+ Status: models.StatusMerged,
Action: "",
Tags: []string{},
ExtraInfo: "",
@@ -176,7 +176,7 @@ func TestGetCommits(t *testing.T) {
{
Sha: "053a66a7be3da43aacdc7aa78e1fe757b82c4dd2",
Name: "refactoring the config struct",
- Status: "merged",
+ Status: models.StatusMerged,
Action: "",
Tags: []string{},
ExtraInfo: "",