From: Adam Majer Date: Wed, 05 Apr 2023 10:28:12 GMT Subject: git clone of empty repositories doesn't preserve hash Message-ID: Hi all, I've noticed while adding support for sha256 repositories for Gitea that, git init --bare --object-format=sha256 a git clone a b Then the repository b is initialized as default hash, so sha1. It seems that receive-pack will list the null OID in the header if there are no refs available, but the upload-pack doesn't list anything and hence the header with capabilities and the hash function is missing git receive-pack a git upload-pack a What is the right approach here? Could upload-pack send a NULL OID followed by header info that is then used by clone? There is a workaround to specify the hash via GIT_DEFAULT_HASH. Not ideal though. Thanks, Adam