if (s == null)
throw new TransportException(getURI(), MessageFormat.format(JGitText.get().transportExceptionEmptyRef, rn));
if (s.startsWith("ref: ")) {
final String target = s.substring("ref: ".length());
Ref r = avail.get(target);
if (r == null)
r = readRef(avail, target);
if (r == null)
r = new ObjectIdRef.Unpeeled(Ref.Storage.NEW, target, null);
r = new SymbolicRef(rn, r);
avail.put(r.getName(), r);
return r;
}
if (ObjectId.isId(s)) {
final Ref r = new ObjectIdRef.Unpeeled(loose(avail.get(rn)),
rn, ObjectId.fromString(s));
avail.put(r.getName(), r);
return r;
}
throw new TransportException(getURI(), MessageFormat.format(JGitText.get().transportExceptionBadRef, rn, s));
}