diff options
author | Shawn Pearce <spearce@spearce.org> | 2011-12-09 10:04:03 -0500 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2011-12-09 10:04:03 -0500 |
commit | 32263d310ccb7c1d59872c74a45cbc8dfbefbbf7 (patch) | |
tree | 756382068acfe08f9c1009da987fc318a11394d4 /org.eclipse.jgit | |
parent | 1291e834df27237cb3769d7d54d93edc0c6ecfbf (diff) | |
parent | 4535a9e2a32c0c3b9f74c76998474fae4e57b321 (diff) | |
download | jgit-32263d310ccb7c1d59872c74a45cbc8dfbefbbf7.tar.gz jgit-32263d310ccb7c1d59872c74a45cbc8dfbefbbf7.zip |
Merge changes I9f1842c2,Ie139133b
* changes:
Throw invalid ref exception instead of invalid remote exception
Use constant for logs directory
Diffstat (limited to 'org.eclipse.jgit')
3 files changed, 13 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java index bd16e3f912..8d0720742f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java @@ -47,7 +47,7 @@ import java.text.MessageFormat; import java.util.Collection; import org.eclipse.jgit.JGitText; -import org.eclipse.jgit.api.errors.InvalidRemoteException; +import org.eclipse.jgit.api.errors.InvalidRefNameException; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.storage.file.ReflogEntry; @@ -91,8 +91,8 @@ public class ReflogCommand extends GitCommand<Collection<ReflogEntry>> { ReflogReader reader = new ReflogReader(repo, ref); return reader.getReverseEntries(); } catch (IOException e) { - throw new InvalidRemoteException(MessageFormat.format( - JGitText.get().cannotRead, ref)); + throw new InvalidRefNameException(MessageFormat.format( + JGitText.get().cannotRead, ref), e); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidRefNameException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidRefNameException.java index 139c41cd5f..287713c82c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidRefNameException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidRefNameException.java @@ -49,4 +49,12 @@ public class InvalidRefNameException extends GitAPIException { public InvalidRefNameException(String msg) { super(msg); } + + /** + * @param msg + * @param cause + */ + public InvalidRefNameException(String msg, Throwable cause) { + super(msg, cause); + } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ReflogReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ReflogReader.java index 1b7fc23e73..cec48f5160 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ReflogReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ReflogReader.java @@ -51,6 +51,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.util.IO; import org.eclipse.jgit.util.RawParseUtils; @@ -66,7 +67,7 @@ public class ReflogReader { * @param refname */ public ReflogReader(Repository db, String refname) { - logName = new File(db.getDirectory(), "logs/" + refname); + logName = new File(db.getDirectory(), Constants.LOGS + '/' + refname); } /** |