summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorGrace Wang <gracewang92@gmail.com>2016-11-22 21:05:39 -0500
committerDavid Pursehouse <david.pursehouse@gmail.com>2016-11-24 03:56:01 -0400
commitfe329f5db4328a58e2cd1c7d1cec6f2676412745 (patch)
tree7f52e09d4215fbd4c9fc8a1e99bc9879e871edba /org.eclipse.jgit
parentc6cfe500b519e7e7b9bfc67ba0af823d3f7a4c92 (diff)
downloadjgit-fe329f5db4328a58e2cd1c7d1cec6f2676412745.tar.gz
jgit-fe329f5db4328a58e2cd1c7d1cec6f2676412745.zip
Specify RevisionSyntaxException message in Repository#resolve
This does not address all cases where no message is specified, only cases where Repository#isValidRefName returns false. Change-Id: Ib88cdabfdcdf37be0053e06949b0e21ad87a9575 Signed-off-by: Grace Wang <gracewang92@gmail.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
index 8b6b28d7c8..c5b2ef8e5b 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
@@ -652,7 +652,10 @@ public abstract class Repository implements AutoCloseable {
// detached
name = Constants.HEAD;
if (!Repository.isValidRefName("x/" + name)) //$NON-NLS-1$
- throw new RevisionSyntaxException(revstr);
+ throw new RevisionSyntaxException(MessageFormat
+ .format(JGitText.get().invalidRefName,
+ name),
+ revstr);
Ref ref = getRef(name);
name = null;
if (ref == null)
@@ -702,7 +705,10 @@ public abstract class Repository implements AutoCloseable {
if (name.equals("")) //$NON-NLS-1$
name = Constants.HEAD;
if (!Repository.isValidRefName("x/" + name)) //$NON-NLS-1$
- throw new RevisionSyntaxException(revstr);
+ throw new RevisionSyntaxException(MessageFormat
+ .format(JGitText.get().invalidRefName,
+ name),
+ revstr);
Ref ref = getRef(name);
name = null;
if (ref == null)
@@ -751,7 +757,9 @@ public abstract class Repository implements AutoCloseable {
return null;
name = revstr.substring(done);
if (!Repository.isValidRefName("x/" + name)) //$NON-NLS-1$
- throw new RevisionSyntaxException(revstr);
+ throw new RevisionSyntaxException(
+ MessageFormat.format(JGitText.get().invalidRefName, name),
+ revstr);
if (getRef(name) != null)
return name;
return resolveSimple(name);