summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorTomasz Zarna <Tomasz.Zarna@pl.ibm.com>2012-03-06 22:43:25 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2012-03-06 22:43:25 +0100
commit90d002c15fd2131b9f80fb9bb6f28bf691c00b5d (patch)
treed5b008b2ab003a7b49543a4181a55d9ab78c02ce /org.eclipse.jgit.test
parente05300b21d5a0479eb278ee38c6d19c956e926f4 (diff)
downloadjgit-90d002c15fd2131b9f80fb9bb6f28bf691c00b5d.tar.gz
jgit-90d002c15fd2131b9f80fb9bb6f28bf691c00b5d.zip
Remove ambiguous CheckoutConflictException
Checkout command should throw o.e.j.api.errors.CheckoutConflictException which is a GitAPIException not o.e.j.errors.CheckoutConflictException. PullCommand should rethrow the API exception as a JGitInternalException. Bug: 356922 Change-Id: I865c4905997d9834c85a97fbe7287604daf99075 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/CheckoutCommandTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java3
2 files changed, 5 insertions, 4 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java
index 7d75a6cda9..b1cac3a54d 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java
@@ -56,6 +56,7 @@ import java.io.FileInputStream;
import java.io.IOException;
import org.eclipse.jgit.api.CheckoutResult.Status;
+import org.eclipse.jgit.api.errors.CheckoutConflictException;
import org.eclipse.jgit.api.errors.InvalidRefNameException;
import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.api.errors.RefAlreadyExistsException;
@@ -127,7 +128,8 @@ public class CheckoutCommandTest extends RepositoryTestCase {
@Test
public void testCheckoutToNonExistingBranch() throws JGitInternalException,
- RefAlreadyExistsException, InvalidRefNameException {
+ RefAlreadyExistsException, InvalidRefNameException,
+ CheckoutConflictException {
try {
git.checkout().setName("badbranch").call();
fail("Should have failed");
@@ -222,7 +224,7 @@ public class CheckoutCommandTest extends RepositoryTestCase {
@Test
public void testDetachedHeadOnCheckout() throws JGitInternalException,
RefAlreadyExistsException, RefNotFoundException,
- InvalidRefNameException, IOException {
+ InvalidRefNameException, IOException, CheckoutConflictException {
CheckoutCommand co = git.checkout();
co.setName("master").call();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
index efb686da59..6c6c911f23 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
@@ -62,7 +62,6 @@ import org.eclipse.jgit.api.MergeResult.MergeStatus;
import org.eclipse.jgit.api.ResetCommand.ResetType;
import org.eclipse.jgit.api.Status;
import org.eclipse.jgit.api.errors.GitAPIException;
-import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.api.errors.NoFilepatternException;
import org.eclipse.jgit.dircache.DirCache;
import org.eclipse.jgit.dircache.DirCacheCheckout;
@@ -1015,7 +1014,7 @@ public class DirCacheCheckoutTest extends RepositoryTestCase {
try {
checkout.call();
fail("Checkout exception not thrown");
- } catch (JGitInternalException e) {
+ } catch (org.eclipse.jgit.api.errors.CheckoutConflictException e) {
CheckoutResult result = checkout.getResult();
assertNotNull(result);
assertNotNull(result.getConflictList());