  We prove an index formula for the Dirac operator acting on two-valued spinors
on a $3$-manifold $M$ which branch along a smoothly embedded graph $\Sigma
\subset M$, and with respect to a boundary condition along $\Sigma$ inspired by
an instance of this setting related to the deformation theory of $\mathbb
Z_2$-harmonic spinors. When $\Sigma$ is a smooth embedded curve, this index
vanishes; this was proved earlier by one of us, but the proof here is different
and extends to the more general setting where $\Sigma$ also has vertices. We
focus primarily on the Dirac operator itself, but also show how our results
apply to more general twisted Dirac operators and to the closely related
$\mathbb Z_2$ harmonic $1$-forms.
