Let $M$ be a riemannian manifold with riemannian metric $g$. The manifold $M$ can be made into a metric space with metric $d$, defined as follows for every couple of points $x,y\in M$ $$d(x,y):=\inf\limits_\gamma l_g(\gamma)$$ with $\gamma:[a,b]\rightarrow M$ with $\gamma(a)=x$ and $\gamma(b)=y$ and $l_g(\gamma)=\int_a^b\sqrt{g(\dot\gamma(t),\dot\gamma(t))}dt$.
With these definitions the curve $\gamma$ which minimizes the distance between $x$ and $y$ (i.e. such that $\gamma(0)=x$, $\gamma(1)=y$ and $l_g(\gamma)=d(x,y)$) is a minimizing geodesic.
I've read that the property of being a minimizing geodesic is stable by restriction: take $\gamma$ as before, then for any $k\in[0,1]$ it is true $l_g(x,\gamma(k))=d(x,\gamma(k))$. I can't find a proof of this fact: why is it true?
Now suppose that $g$ has some points of singularity (for example $g$ is a flat metric with conical singularities). Is it still true that the property of being a minimizing geodesic is stable by restriction?