On 2023-04-05 at 21:15:33, Junio C Hamano wrote: > A user could prepare an empty repository and set it to use SHA256 as > the object format. The new repository created by "git clone" from > such a repository however would not record that it is expecting > objects in the same SHA256 format. This works as expected if the > source repository is not empty. > > Just like we started copying the name of the primary branch from the > remote repository even if it is unborn in 3d8314f8 (clone: propagate > empty remote HEAD even with other branches, 2022-07-07), lift the > code that records the object format out of the block executed only > when cloning from an instantiated repository, so that it works also > when cloning from an empty repository. Yeah, this looks like the right thing to do. I know this did work originally, at least for protocol v2, but I may have neglected to add a test when I wrote it and it regressed. Thanks for the patch, which I think is obviously correct, and adding a test for this case. -- brian m. carlson (he/him or they/them) Toronto, Ontario, CA