It used to be like you suggest. Then this was discussed on the previous commit (outdated diff), so I changed it.

> Just came across #20276, which suggests that this conditional on build.stable? is not ok. Is that still the case?

@jacknagel suggested:
> The code should be in a stable, devel, or head block if it can be expressed that way; if it only applies to two out of the three then repeating code is preferable to the problems that arise from using a conditional.