aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2012-09-03 08:15:31 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2012-09-03 08:15:31 -0400
commit32e952fefda1d97385e92a5621324485c3886cc2 (patch)
treefc3511ae84632538e825108d2b847124f902110c /org.eclipse.jgit
parent9d3110e72d943bae6139d4ddfc3ebd6e9d00b0e8 (diff)
parent252727c4fcfb1277661b9e9e3396e6ccd488cc82 (diff)
downloadjgit-32e952fefda1d97385e92a5621324485c3886cc2.tar.gz
jgit-32e952fefda1d97385e92a5621324485c3886cc2.zip
Merge "Support branches with name 'config'"
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java
index 3d082fb4af..6ae3f8cc8b 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java
@@ -73,6 +73,7 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
+import org.eclipse.jgit.errors.InvalidObjectIdException;
import org.eclipse.jgit.errors.LockFailedException;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.errors.ObjectWritingException;
@@ -260,10 +261,17 @@ public class RefDirectory extends RefDatabase {
final RefList<Ref> packed = getPackedRefs();
Ref ref = null;
for (String prefix : SEARCH_PATH) {
- ref = readRef(prefix + needle, packed);
- if (ref != null) {
- ref = resolve(ref, 0, null, null, packed);
- break;
+ try {
+ ref = readRef(prefix + needle, packed);
+ if (ref != null) {
+ ref = resolve(ref, 0, null, null, packed);
+ break;
+ }
+ } catch (IOException e) {
+ if (!(!needle.contains("/") && "".equals(prefix) && e
+ .getCause() instanceof InvalidObjectIdException)) {
+ throw e;
+ }
}
}
fireRefsChanged();
@@ -937,7 +945,11 @@ public class RefDirectory extends RefDatabase {
while (0 < n && Character.isWhitespace(buf[n - 1]))
n--;
String content = RawParseUtils.decode(buf, 0, n);
- throw new IOException(MessageFormat.format(JGitText.get().notARef, name, content));
+
+ IOException ioException = new IOException(MessageFormat.format(JGitText.get().notARef,
+ name, content));
+ ioException.initCause(notRef);
+ throw ioException;
}
return new LooseUnpeeled(otherSnapshot, name, id);
}