remote-curl: fix clone on sha256 repos

The remote-https process needs to update it's own instance of `the_repository' when it sees an HTTP(S) remote is using sha256. Without this, parse_oid_hex() fails to handle sha256 OIDs when it's eventually called by parse_fetch(). Tested with: git clone https://yhbt.net/sha256test.git GIT_SMART_HTTP=0 git clone https://yhbt.net/sha256test.git (plain http:// also works) Cloning the URL via git:// required no changes Signed-off-by: Eric Wong <e@80x24.org> Acked-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Wong committed May 11, 2021 at 10:37 UTC 00bc8390d8cd764c52f0308b303a270e9bf57d84
1 file changed +2
remote-curl.c
+2
@@ -555,6 +555,8 @@ static void output_refs(struct ref *refs)
555 struct ref *posn;
556 if (options.object_format && options.hash_algo) {
557 printf(":object-format %s\n", options.hash_algo->name);
558 + repo_set_hash_algo(the_repository,
559 + hash_algo_by_ptr(options.hash_algo));
560 }
561 for (posn = refs; posn; posn = posn->next) {
562 if (posn->symref)