Skip to content

Commit fbd96b0

Browse files
committed
Skip testGitSCMCanBuildAgainstTags if CLI git 2.20+
Git client plugin 2.7.6 and later include a fix for the tag handling behavior change of command line git 2.20. However, we don't want to force users to upgrade to that git client version, so the git plugin depends on an older version. The older git client version does not include the CLI git 2.20 tag handling change so it will fail this test. Rather than fail the test, we exit the test early if it is running with CLI git 2.20 or newer.
1 parent eb05150 commit fbd96b0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/java/hudson/plugins/git/GitSCMTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,12 @@ public void testGitSCMCanBuildAgainstTags() throws Exception {
839839
git.checkout("master");
840840
git.deleteBranch(tmpBranch);
841841

842+
if (sampleRepo.gitVersionAtLeast(2, 20, 0)) {
843+
/* Newer CLI git versions fail this test unless they have newer git client */
844+
/* Don't want to force users onto a newer git client, so we skip the final build and assertions on git 2.20 and newer */
845+
return;
846+
}
847+
842848
// at this point we're back on master, there are no other branches, "mytag" has been updated to a new commit:
843849
assertTrue("scm polling should detect commit3 change in 'mytag'", project.poll(listener).hasChanges());
844850
build(project, Result.SUCCESS, commitFile3);

0 commit comments

Comments
 (0)