Skip to content

Commit 7772f32

Browse files
authored
Tests: Disable Git Commit Signing in Tests (#397)
The test suite creates a tiny test suite with a custom user email. If a developer working on Swiftly has commit signing enabled, that tool will see that the committer email and the signing identity don't match, and will fail to sign the commit, causing the `testGit` test to fail. Disabling gpg signing commits in the temporary test repo.
1 parent 747e8c0 commit 7772f32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Tests/SwiftlyTests/CommandLineTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ public struct CommandLineTests {
9595
// AND a simple history
9696
try "Some text".write(to: tmp / "foo.txt", atomically: true)
9797
try await Swiftly.currentPlatform.runProgram("git", "-C", "\(tmp)", "add", "foo.txt")
98-
try await Swiftly.currentPlatform.runProgram("git", "-C", "\(tmp)", "config", "user.email", "[email protected]")
98+
try await Swiftly.currentPlatform.runProgram("git", "-C", "\(tmp)", "config", "--local", "user.email", "[email protected]")
99+
try await Swiftly.currentPlatform.runProgram("git", "-C", "\(tmp)", "config", "--local", "commit.gpgsign", "false")
99100
try await sys.git(.workingDir(tmp)).commit(.message("Initial commit")).run(Swiftly.currentPlatform)
100101
try await sys.git(.workingDir(tmp)).diffindex(.quiet, tree_ish: "HEAD").run(Swiftly.currentPlatform)
101102

0 commit comments

Comments
 (0)