ocaml-opam/opam-publish

Broken if the initial opam-repository clone fails

AltGr opened this issue · 3 comments

AltGr commented

We only check if e.g. the dir ~/.opam/plugins/opam-publish/repos/ocaml%opam-repository exists before deciding wether to clone or update. It happened that the initial clone failed, but the directory still existed (without a proper .git).

Then all attempts would fail while trying to run git fetch in there. It would be nice to have better detection, or recover the git error to clone again from scratch.

Discovered by user @sanette on https://discuss.ocaml.org/t/best-way-to-publish-opam-package/4036/17 : thanks!

Hi @rjbou and @AltGr,

I have entered into this situation where /usr/bin/git fetch --multiple origin user is called (and fails) after an initial incomplete opam publish. Could you please tell me how do I reverse this situation?

@DmxLarchey as a quick fix rm -rf ~/.opam/plugins/opam-publish/repos/ocaml%opam-repository should work

@kit-ty-kate

Thank you very much. It worked !! And publishing now succeeded !!