Skip to content

Commit 50c3a84

Browse files
committed
simplify test, remove misleading comment
1 parent b14747f commit 50c3a84

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

internal/config/git_test.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"os"
66
"os/exec"
77
"testing"
8-
"strings"
98

109
"github.com/stretchr/testify/assert"
1110
)
@@ -101,13 +100,9 @@ func TestGetPrefixParsesArgs(t *testing.T) {
101100

102101
config, _ := GetConfig(localRepo)
103102
prefix := config.GetPrefix("receive.fsck.")
104-
var result string
105-
for key, value := range prefix {
106-
result += key + "=" + strings.Join(value, ",") + ","
107-
}
108-
result = strings.TrimSuffix(result, ",")
109-
result = "strict=" + result
110-
assert.Equal(t, "strict=missingemail=ignore,badtagname=ignore", result)
103+
104+
assert.Equal(t, prefix["missingemail"][0], "ignore")
105+
assert.Equal(t, prefix["badtagname"][0], "ignore")
111106
}
112107

113108

internal/integration/integration_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ func (suite *SpokesReceivePackTestSuite) TestSpokesReceivePackWrongObjectSucceed
381381

382382
func (suite *SpokesReceivePackTestSuite) TestSpokesReceivePackIgnoreArgsSucceed() {
383383
assert.NoError(suite.T(), chdir(suite.T(), suite.remoteRepo), "unable to chdir into our remote Git repo")
384-
// Disable the `receive.fsckObjects option
385384
require.NoError(suite.T(), exec.Command("git", "config", "receive.fsckObjects", "true").Run())
386385
require.NoError(suite.T(), exec.Command("git", "config", "receive.fsck.missingEmail", "ignore").Run())
387386
require.NoError(suite.T(), exec.Command("git", "config", "receive.fsck.badTagName", "ignore").Run())
@@ -398,7 +397,6 @@ func (suite *SpokesReceivePackTestSuite) TestSpokesReceivePackIgnoreArgsSucceed(
398397

399398
func (suite *SpokesReceivePackTestSuite) TestSpokesReceivePackMissingArgsFails() {
400399
assert.NoError(suite.T(), chdir(suite.T(), suite.remoteRepo), "unable to chdir into our remote Git repo")
401-
// Disable the `receive.fsckObjects option
402400
require.NoError(suite.T(), exec.Command("git", "config", "receive.fsckObjects", "true").Run())
403401
require.NoError(suite.T(), exec.Command("git", "config", "receive.fsck.missingEmail", "error").Run())
404402
require.NoError(suite.T(), exec.Command("git", "config", "receive.fsck.badTagName", "error").Run())

0 commit comments

Comments
 (0)