diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java index f4a3a6289..1afc6d808 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java @@ -459,9 +459,13 @@ public class TestRepository { */ public T update(String ref, T obj) throws Exception { if (Constants.HEAD.equals(ref)) { + // nothing } else if ("FETCH_HEAD".equals(ref)) { + // nothing } else if ("MERGE_HEAD".equals(ref)) { + // nothing } else if (ref.startsWith(Constants.R_REFS)) { + // nothing } else ref = Constants.R_HEADS + ref; @@ -537,7 +541,9 @@ public class TestRepository { */ public BranchBuilder branch(String ref) { if (Constants.HEAD.equals(ref)) { + // nothing } else if (ref.startsWith(Constants.R_REFS)) { + // nothing } else ref = Constants.R_HEADS + ref; return new BranchBuilder(ref); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java index 33c362305..727315047 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java @@ -219,5 +219,6 @@ public abstract class RefDatabase { * Implementors should overwrite this method if they use any kind of caches. */ public void refresh() { + // nothing } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java index d9673f74e..bcf0a8ba2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java @@ -277,12 +277,14 @@ abstract class HttpAuthMethod { r.append("://"); r.append(u.getHost()); if (0 < u.getPort()) { - if (u.getPort() == 80 && "http".equals(u.getProtocol())) - /* nothing */; - else if (u.getPort() == 443 && "https".equals(u.getProtocol())) - /* nothing */; - else + if (u.getPort() == 80 && "http".equals(u.getProtocol())) { + /* nothing */ + } else if (u.getPort() == 443 + && "https".equals(u.getProtocol())) { + /* nothing */ + } else { r.append(':').append(u.getPort()); + } } r.append(u.getPath()); if (u.getQuery() != null)