Let $$f:X\to Y$$ be a holomorphic map between compact connected Riemann surfaces and let $$L\to X$$ be a holomorphic line bundle on $X$. I'm having some trouble understanding the fact that the direct image $f_*\mathcal{O}(L)$ of the sheaf of sections of $L$ is isomorphic to the sheaf of sections of a holomorphic vector bundle $E$ on $Y$ whose rank is the degree $m$ of $f$.
I understand that we need to show that $f_*\mathcal{O}(L)$ is locally free, and it is easy to see that this is the case around any regular value $y\in Y$. Indeed, in that case $f^{-1}(y)$ contains $m$ points and we can find a small neighbourhood $U$ of $y$ such that $f^{-1}(U)=\bigsqcup_{i=1}^mU_i$ where $U_i\cong U$ so we have $(f_*\mathcal{O}(L))(U) \cong \bigoplus_{i=1}^m \mathcal{O}(L)(U_i)\cong\bigoplus_{i=1}^m\mathcal{O}(U)$ for $U$ small enough.
But I don't understand what happens over a branch point. In the simplest case, let's say $f:\mathbb{C}\to\mathbb{C}$, $f(z)=z^2$, with $L$ trivial. Then, for any small disc $\mathbb{D}_r$ of radius $r$ around $0$ we have $f^{-1}(\mathbb{D}_r)=\mathbb{D}_{\sqrt{r}}$ so $$(f_*\mathcal{O})(\mathbb{D}_r)=\mathcal{O}(\mathbb{D}_{\sqrt{r}})$$ which is not isomorphic to $\mathcal{O}(\mathbb{D}_r)\oplus\mathcal{O}(\mathbb{D}_r)$ as it should be. What is wrong with this argument?