Subject: Re: [PATCH 3/3] setup: fix reinit of repos with incompatible GIT_DEFAULT_HASH

From: Junio C Hamano <[email-masked]>
Date: Fri, 31 Jan 2025 14:40:43 -0800

Patrick Steinhardt <[email-masked]> writes:

> The exact same issue as described in the preceding commit also exists
> for GIT_DEFAULT_HASH. Thus, reinitializing a repository that e.g. uses
> SHA1 with `GIT_DEFAULT_HASH=sha256 git init` will cause the object
> format of that repository to change to SHA256. This is of course bogus
> as any existing objects and refs will not be converted, thus causing
> repository corruption:

The exact same comment on silently ignoring applies, but unlike the
previous one, converting the entire history is far more expensive,
so it may be much less likely to be worth going the automatic
conversion route than the previous one.

Thanks.