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:
Han-Wen Nienhuys
2019-01-07 17:37:20 +01:00
parent 978ba376f2
commit 35b206c5ef
2 changed files with 8 additions and 9 deletions

View File

@@ -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();

View File

@@ -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);
}
}
}