Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 244f86e

Browse files
DamnedElricHillkorn
authored andcommittedJul 8, 2024·
Fix GitReleasePluginTests when global .gitconfig contains custom pretty format settings
Test case "commitOptions are passed through to git command" would fail on my machine due to custom pretty format settings: ~/.gitconfig: [format] pretty = %Cgreen%ci:%C(yellow)%d%Creset|%G?|%s (%Cred%h%Creset by %C(bold blue)%an%Creset) %ae [%GS] This resulted in the following test failure: Condition not satisfied: newestCommit.contains("Signed-off-by: Unit Test <unit@test>") | | | false 2023-03-26 15:23:54 +0200: (myBranch)|N|[Gradle Release Plugin] - new version commit: '1.1'. (40b3a21 by Unit Test) unit@test [] at net.researchgate.release.GitReleasePluginTests.commitOptions are passed through to git command(GitReleasePluginTests.groovy:133)
1 parent e842cc7 commit 244f86e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/test/groovy/net/researchgate/release/GitReleasePluginTests.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class GitReleasePluginTests extends Specification {
126126
}
127127
}
128128
(project.tasks.commitNewVersion as CommitNewVersion).commitNewVersion()
129-
String newestCommit = executor.exec(['git', 'show', 'myBranch', '-s'], failOnStderr: false, directory: remoteRepo, env: [:])
129+
String newestCommit = executor.exec(['git', 'show', 'myBranch', '-s', '--pretty=medium'], failOnStderr: false, directory: remoteRepo, env: [:])
130130
executor.exec(['git', 'checkout', 'myBranch'], failOnStderr: false, directory: remoteRepo, env: [:])
131131
executor.exec(['git', 'reset', '--hard', 'HEAD'], failOnStderr: false, directory: remoteRepo, env: [:])
132132
then:

0 commit comments

Comments
 (0)
Please sign in to comment.