Skip to content

Commit

Permalink
simplify test, remove misleading comment
Browse files Browse the repository at this point in the history
  • Loading branch information
RidhwaanDev committed Apr 18, 2024
1 parent b14747f commit 50c3a84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 3 additions & 8 deletions internal/config/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"os"
"os/exec"
"testing"
"strings"

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

config, _ := GetConfig(localRepo)
prefix := config.GetPrefix("receive.fsck.")
var result string
for key, value := range prefix {
result += key + "=" + strings.Join(value, ",") + ","
}
result = strings.TrimSuffix(result, ",")
result = "strict=" + result
assert.Equal(t, "strict=missingemail=ignore,badtagname=ignore", result)

assert.Equal(t, prefix["missingemail"][0], "ignore")
assert.Equal(t, prefix["badtagname"][0], "ignore")
}


Expand Down
2 changes: 0 additions & 2 deletions internal/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ func (suite *SpokesReceivePackTestSuite) TestSpokesReceivePackWrongObjectSucceed

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

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

0 comments on commit 50c3a84

Please sign in to comment.