Sometimes the git repo cached on the docker image gets corrupted on Windows, in which case there is no way to clean things and resolve that error. For example: https://gitlab.freedesktop.org/bilboed/gst-plugins-bad/-/jobs/5517037
++ cp -a C:/cerbero/.git . cp: cannot create regular file `./.git/objects/pack/pack-cbdde9dc4dd07bff6761e6715e20d7c0abe62b9e.idx': Permission denied cp: cannot create regular file `./.git/objects/pack/pack-cbdde9dc4dd07bff6761e6715e20d7c0abe62b9e.pack': Permission denied
Always delete the cached git repo and copy a pristine copy from the image. This will also avoid accumulation of garbage in the git repo.