setup: set the_repository's hash algo when checking format
commitd553acebeeda584e0e749cfe04dad450c667de90
authorbrian m. carlson <sandals@crustytoothpaste.net>
Mon, 25 May 2020 19:59:08 +0000 (25 19:59 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 May 2020 17:07:06 +0000 (27 10:07 -0700)
treef8772263a2f4b2f73524b19dcc8d8d32881ce840
parent4b831208bb365fedd0cce286e0c27627598d9393
setup: set the_repository's hash algo when checking format

When we're checking the repository's format, set the hash algorithm at
the same time.  This ensures that we perform a suitable initialization
early enough to avoid confusing any parts of the code.  If we defer
until later, we can end up with portions of the code which are confused
about the hash algorithm, resulting in segfaults when working with
SHA-256 repositories.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
setup.c