Skip to content

Commit f988d25

Browse files
committed
Remove symref test conditionals
All supported versions of command line git include symref support so there is no need for conditionals that check for symref support before running the tests.
1 parent f8623ad commit f988d25

File tree

4 files changed

+0
-25
lines changed

4 files changed

+0
-25
lines changed

src/test/java/org/jenkinsci/plugins/gitclient/CliGitAPIImplTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ protected GitClient setupGitAPI(File ws) throws Exception {
1616
return Git.with(listener, env).in(ws).using("git").getClient();
1717
}
1818

19-
@Override
20-
protected boolean hasWorkingGetRemoteSymbolicReferences() {
21-
return ((CliGitAPIImpl) (w.git)).isAtLeastVersion(2, 8, 0, 0);
22-
}
23-
2419
public static class VersionTest {
2520

2621
private boolean expectedIsAtLeastVersion;

src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestUpdate.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,8 +1219,6 @@ public void testGetHeadRevNamespacesWithSimpleBranchNames() throws Exception {
12191219
}
12201220
}
12211221

1222-
protected abstract boolean hasWorkingGetRemoteSymbolicReferences();
1223-
12241222
private Properties parseLsRemote(File file) throws IOException {
12251223
Properties properties = new Properties();
12261224
Pattern pattern = Pattern.compile("([a-f0-9]{40})\\s*(.*)");
@@ -1243,10 +1241,6 @@ private Properties parseLsRemote(File file) throws IOException {
12431241
*/
12441242
@Test
12451243
public void testGetRemoteSymbolicReferencesWithMatchingPattern() throws Exception {
1246-
if (!hasWorkingGetRemoteSymbolicReferences()) {
1247-
/* Do not distract warnings system by using assumeThat to skip tests */
1248-
return;
1249-
}
12501244
Map<String, String> references = w.git.getRemoteSymbolicReferences(remoteMirrorURL, Constants.HEAD);
12511245
assertThat(references, hasEntry(is(Constants.HEAD), is(Constants.R_HEADS + DEFAULT_JGIT_BRANCH_NAME)));
12521246
assertThat(references.size(), is(1));
@@ -1800,10 +1794,6 @@ public void testRevListRemoteBranch() throws Exception {
18001794
*/
18011795
@Test
18021796
public void testGetRemoteSymbolicReferences() throws Exception {
1803-
if (!hasWorkingGetRemoteSymbolicReferences()) {
1804-
/* Do not distract warnings system by using assumeThat to skip tests */
1805-
return;
1806-
}
18071797
Map<String, String> references = w.git.getRemoteSymbolicReferences(remoteMirrorURL, null);
18081798
assertThat(references, hasEntry(is(Constants.HEAD), is(Constants.R_HEADS + DEFAULT_JGIT_BRANCH_NAME)));
18091799
}

src/test/java/org/jenkinsci/plugins/gitclient/JGitAPIImplTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ protected GitClient setupGitAPI(File ws) throws Exception {
1111
return Git.with(listener, env).in(ws).using("jgit").getClient();
1212
}
1313

14-
@Override
15-
protected boolean hasWorkingGetRemoteSymbolicReferences() {
16-
return true; // JGit 5.10 has getRemoteSymbolicReferences, prior did not
17-
}
18-
1914
@Override
2015
protected boolean getTimeoutVisibleInCurrentTest() {
2116
return true; // git client plugin 3.11.0 supports JGit timeout

src/test/java/org/jenkinsci/plugins/gitclient/JGitApacheAPIImplTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ protected GitClient setupGitAPI(File ws) throws Exception {
1111
return Git.with(listener, env).in(ws).using("jgitapache").getClient();
1212
}
1313

14-
@Override
15-
protected boolean hasWorkingGetRemoteSymbolicReferences() {
16-
return true; // JGit 5.10 gets remote symbolic references, prior did not
17-
}
18-
1914
@Override
2015
protected boolean getTimeoutVisibleInCurrentTest() {
2116
return true; // git client plugin 3.11.0 supports JGit timeout

0 commit comments

Comments
 (0)