Please describe the problem.

When there is a gpg error upon initializing a special remote with shared encryption, the error is effectively skipped and unencrypted content is synced.

What steps will reproduce the problem?

  • configure a broken/weird version of gpg (e.g. git config gpg.program echo reproduces this but I used the ots-git-gpg-wrapper.sh from OpenTimeStamps - that's probably an upstream error but I'd consider a broken gpg not-so-uncommon problem)
  • in an annex repo, run git annex initremote testrepo type=rsync rsyncurl=ssh://... encryption=shared
    • Not enough bytes returned from gpg [Param "--gen-random",Param "--armor",Param "2",Param "512"] (got 56 ; ex pected 682 )
    • exits with code 1
    • puts nothing in git show git-annex:remote.log but leaves behind a working local git remote that looks to git-annex as an unencrypted remote
  • git annex sync --content happily syncs unencrypted content

I guess a sane behaviour would be to not add the local git remote and stop right after encountering the error.

What version of git-annex are you using? On what operating system?

tried with 10.20230329 and 10.20230408+gc70677e31 on Manjaro

Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)

It's awesome 👍

Indeed, there was a laziness bug that prevented it from exiting early enough. fixed --Joey