diff options
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java index a41ff8454b..6a5c0bc0e0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java @@ -51,6 +51,7 @@ import java.util.List; 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; @@ -62,7 +63,6 @@ import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit; 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; @@ -124,7 +124,8 @@ public class CheckoutCommand extends GitCommand<Ref> { * @return the newly created branch */ public Ref call() throws JGitInternalException, RefAlreadyExistsException, - RefNotFoundException, InvalidRefNameException { + RefNotFoundException, InvalidRefNameException, + CheckoutConflictException { checkCallable(); processOptions(); try { @@ -164,10 +165,10 @@ public class CheckoutCommand extends GitCommand<Ref> { 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)) |