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;
@Test
public void testCheckoutToNonExistingBranch() throws JGitInternalException,
- RefAlreadyExistsException, InvalidRefNameException {
+ RefAlreadyExistsException, InvalidRefNameException,
+ CheckoutConflictException {
try {
git.checkout().setName("badbranch").call();
fail("Should have failed");
@Test
public void testDetachedHeadOnCheckout() throws JGitInternalException,
RefAlreadyExistsException, RefNotFoundException,
- InvalidRefNameException, IOException {
+ InvalidRefNameException, IOException, CheckoutConflictException {
CheckoutCommand co = git.checkout();
co.setName("master").call();
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;
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());
import org.eclipse.jgit.JGitText;
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;
import org.eclipse.jgit.dircache.DirCacheEntry;
import org.eclipse.jgit.dircache.DirCacheIterator;
import org.eclipse.jgit.errors.AmbiguousObjectException;
-import org.eclipse.jgit.errors.CheckoutConflictException;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.FileMode;
* @return the newly created branch
*/
public Ref call() throws JGitInternalException, RefAlreadyExistsException,
- RefNotFoundException, InvalidRefNameException {
+ RefNotFoundException, InvalidRefNameException,
+ CheckoutConflictException {
checkCallable();
processOptions();
try {
dco.setFailOnConflict(true);
try {
dco.checkout();
- } catch (CheckoutConflictException e) {
+ } catch (org.eclipse.jgit.errors.CheckoutConflictException e) {
status = new CheckoutResult(Status.CONFLICTS, dco
.getConflicts());
- throw e;
+ throw new CheckoutConflictException(dco.getConflicts(), e);
}
Ref ref = repo.getRef(name);
if (ref != null && !ref.getName().startsWith(Constants.R_HEADS))
import org.eclipse.jgit.JGitText;
import org.eclipse.jgit.api.RebaseResult.Status;
+import org.eclipse.jgit.api.errors.CheckoutConflictException;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.InvalidRefNameException;
import org.eclipse.jgit.api.errors.JGitInternalException;
throw new JGitInternalException(e.getMessage(), e);
} catch (InvalidRefNameException e) {
throw new JGitInternalException(e.getMessage(), e);
+ } catch (CheckoutConflictException e) {
+ throw new JGitInternalException(e.getMessage(), e);
}
}
* list of conflicting paths
*
* @param e
+ * a {@link org.eclipse.jgit.errors.CheckoutConflictException}
+ * exception
*/
public CheckoutConflictException(List<String> conflictingPaths,
org.eclipse.jgit.errors.CheckoutConflictException e) {