Fix layout-fragile git-root assertion in source code metadata test (#25855)