Propagate IOException in TagMatcher
This causes a 500 rather than silently omitting a tag from the ref advertisement. Change-Id: I868dd65b285a9b5cd8ce37152d89f086e692f605
This commit is contained in:
@@ -51,13 +51,8 @@ public class TagMatcher {
|
||||
this.updated = updated;
|
||||
}
|
||||
|
||||
public boolean isReachable(Ref tagRef) {
|
||||
try {
|
||||
tagRef = db.getRefDatabase().peel(tagRef);
|
||||
} catch (IOException e) {
|
||||
// Ignore
|
||||
}
|
||||
|
||||
public boolean isReachable(Ref tagRef) throws IOException {
|
||||
tagRef = db.getRefDatabase().peel(tagRef);
|
||||
ObjectId tagObj = tagRef.getPeeledObjectId();
|
||||
if (tagObj == null) {
|
||||
tagObj = tagRef.getObjectId();
|
||||
|
||||
@@ -255,8 +255,12 @@ class DefaultRefFilter {
|
||||
.values()
|
||||
: result.values());
|
||||
for (Ref tag : deferredTags) {
|
||||
if (tags.isReachable(tag)) {
|
||||
result.put(tag.getName(), tag);
|
||||
try {
|
||||
if (tags.isReachable(tag)) {
|
||||
result.put(tag.getName(), tag);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new PermissionBackendException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user