summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2018-06-10 12:12:05 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2018-06-10 12:12:16 +0200
commit0f8f6746ed5c7ce68203618e2528267dab466ffb (patch)
tree166acd90e5b0b228d8b80e50e64f1e7718245167 /org.eclipse.jgit.test
parentd2cb1e7bf5af1e401c8f1f982987190831dbc5b6 (diff)
parent4ef8769f81949d1b5759645bdba969b6b5a7289a (diff)
downloadjgit-0f8f6746ed5c7ce68203618e2528267dab466ffb.tar.gz
jgit-0f8f6746ed5c7ce68203618e2528267dab466ffb.zip
Merge branch 'stable-5.0'
* stable-5.0: Ensure Jsch checks all configured algorithms RawTextTest#testBinary: use array comparison to compare arrays LFS: Better SSH authentication token timeout handling Ensure DirectoryStream is closed promptly Validate branch names on branch creation Change-Id: Ic4f6a24b6ccee6730eee3fd5dcb0d1f3e291c478 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BranchCommandTest.java12
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextTest.java3
2 files changed, 14 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BranchCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BranchCommandTest.java
index 2fe40b99ed..08f1fdfacf 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BranchCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BranchCommandTest.java
@@ -191,6 +191,18 @@ public class BranchCommandTest extends RepositoryTestCase {
- allBefore);
}
+ @Test(expected = InvalidRefNameException.class)
+ public void testInvalidBranchHEAD() throws Exception {
+ git.branchCreate().setName("HEAD").call();
+ fail("Create branch with invalid ref name should fail");
+ }
+
+ @Test(expected = InvalidRefNameException.class)
+ public void testInvalidBranchDash() throws Exception {
+ git.branchCreate().setName("-x").call();
+ fail("Create branch with invalid ref name should fail");
+ }
+
@Test
public void testListAllBranchesShouldNotDie() throws Exception {
setUpRepoWithRemote().branchList().setListMode(ListMode.ALL).call();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextTest.java
index 8cf3eedfdd..58a8b2d468 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextTest.java
@@ -45,6 +45,7 @@
package org.eclipse.jgit.diff;
import static org.eclipse.jgit.lib.Constants.CHARSET;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
@@ -69,7 +70,7 @@ public class RawTextTest {
String input = "foo-a\nf\0o-b\n";
byte[] data = Constants.encodeASCII(input);
final RawText a = new RawText(data);
- assertEquals(a.content, data);
+ assertArrayEquals(a.content, data);
assertEquals(a.size(), 1);
assertEquals(a.getString(0, 1, false), input);
}