builtin/clone: initialize hash algorithm properly
authorbrian m. carlson <sandals@crustytoothpaste.net>
Mon, 25 May 2020 19:59:05 +0000 (19:59 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 May 2020 17:07:06 +0000 (10:07 -0700)
commitb65dc2cebd6ac7d869895297ed5061af15428544
treec20a67ad36062c7e5dd6ac71b6cfd442894ebf48
parent7f60501775b2a0e0dcabb98fde3eb46fd980a8cc
builtin/clone: initialize hash algorithm properly

When performing a clone, we don't know what hash algorithm the other end
will support.  Currently, we don't support fetching data belonging to a
different algorithm, so we must know what algorithm the remote side is
using in order to properly initialize the repository.  We can know that
only after fetching the refs, so if the remote side has any references,
use that information to reinitialize the repository with the correct
hash algorithm information.

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