Skip to content

Commit

Permalink
Fix GitReleasePluginTests when global .gitconfig contains custom pret…
Browse files Browse the repository at this point in the history
…ty 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)
  • Loading branch information
DamnedElric authored and Hillkorn committed Jul 8, 2024
1 parent e842cc7 commit 244f86e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class GitReleasePluginTests extends Specification {
}
}
(project.tasks.commitNewVersion as CommitNewVersion).commitNewVersion()
String newestCommit = executor.exec(['git', 'show', 'myBranch', '-s'], failOnStderr: false, directory: remoteRepo, env: [:])
String newestCommit = executor.exec(['git', 'show', 'myBranch', '-s', '--pretty=medium'], failOnStderr: false, directory: remoteRepo, env: [:])
executor.exec(['git', 'checkout', 'myBranch'], failOnStderr: false, directory: remoteRepo, env: [:])
executor.exec(['git', 'reset', '--hard', 'HEAD'], failOnStderr: false, directory: remoteRepo, env: [:])
then:
Expand Down

0 comments on commit 244f86e

Please sign in to comment.