aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/api
diff options
context:
space:
mode:
authorTomasz Zarna <tomasz.zarna@tasktop.com>2012-11-11 23:38:44 +0100
committerChris Aniszczyk <zx@twitter.com>2012-11-15 16:28:02 -0800
commitcb0f0ad4cfe2733ff09c2ce4d3b72265ccfee281 (patch)
tree7ad383723b37911c725ff8569960325efee9affd /org.eclipse.jgit/src/org/eclipse/jgit/api
parent790126c1457fba6c85680dc7858b4c84e84ea640 (diff)
downloadjgit-cb0f0ad4cfe2733ff09c2ce4d3b72265ccfee281.tar.gz
jgit-cb0f0ad4cfe2733ff09c2ce4d3b72265ccfee281.zip
Add a test for org.eclipse.jgit.pgm.Tag
The test checks if an error is thrown when trying to create the same tag for the second time. Change-Id: I4ed2f6c997587f0ea23bd26a32fb64a2d48a980e Signed-off-by: Chris Aniszczyk <zx@twitter.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java
index cef9e18349..8d887e3548 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java
@@ -50,6 +50,7 @@ import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.InvalidTagNameException;
import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.api.errors.NoHeadException;
+import org.eclipse.jgit.api.errors.RefAlreadyExistsException;
import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
@@ -151,6 +152,11 @@ public class TagCommand extends GitCommand<Ref> {
throw new ConcurrentRefUpdateException(
JGitText.get().couldNotLockHEAD,
tagRef.getRef(), updateResult);
+ case REJECTED:
+ throw new RefAlreadyExistsException(
+ MessageFormat.format(
+ JGitText.get().tagAlreadyExists,
+ newTag.toString()));
default:
throw new JGitInternalException(MessageFormat.format(
JGitText.get().updatingRefFailed, refName,