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;
|
this.updated = updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isReachable(Ref tagRef) {
|
public boolean isReachable(Ref tagRef) throws IOException {
|
||||||
try {
|
tagRef = db.getRefDatabase().peel(tagRef);
|
||||||
tagRef = db.getRefDatabase().peel(tagRef);
|
|
||||||
} catch (IOException e) {
|
|
||||||
// Ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
ObjectId tagObj = tagRef.getPeeledObjectId();
|
ObjectId tagObj = tagRef.getPeeledObjectId();
|
||||||
if (tagObj == null) {
|
if (tagObj == null) {
|
||||||
tagObj = tagRef.getObjectId();
|
tagObj = tagRef.getObjectId();
|
||||||
|
|||||||
@@ -255,8 +255,12 @@ class DefaultRefFilter {
|
|||||||
.values()
|
.values()
|
||||||
: result.values());
|
: result.values());
|
||||||
for (Ref tag : deferredTags) {
|
for (Ref tag : deferredTags) {
|
||||||
if (tags.isReachable(tag)) {
|
try {
|
||||||
result.put(tag.getName(), tag);
|
if (tags.isReachable(tag)) {
|
||||||
|
result.put(tag.getName(), tag);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new PermissionBackendException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user