Re: [PATCH 35/44] remote-curl: detect algorithm for dumb HTTP by size
- From
- Martin Ågren <martin.agren@gmail.com>
- Date
- May 16, 2020, 11:17 UTC
- Message-ID
- <CAN0heSqcv6cTJcptOo=BgTwxcTkdL+mm-HKgX4UBnTscECJJTg@mail.gmail.com>
- In-Reply-To
- <20200513005424.81369-36-sandals@crustytoothpaste.net>
On Wed, 13 May 2020 at 02:57, brian m. carlson <sandals@crustytoothpaste.net> wrote:
Show 5 quoted lines
> + options.hash_algo = detect_hash_algo(heads);
> + if (!options.hash_algo)
> + die("%sinfo/refs not valid: could not determine hash algorithm; "
> + "is this a git repository?",
> + url.buf);Should this use `transport_anonymize_url()`?
Show 5 quoted lines
> if (data[i] == '\n') {
> - if (mid - start != the_hash_algo->hexsz)
> + if (mid - start != options.hash_algo->hexsz)
> die(_("%sinfo/refs not valid: is this a git repository?"),
> transport_anonymize_url(url.buf));Like here and elsewhere.
Show 5 quoted lines
> data[i] = 0; > ref_name = mid + 1; > ref = alloc_ref(ref_name); > - get_oid_hex(start, &ref->old_oid); > + get_oid_hex_algop(start, &ref->old_oid, options.hash_algo);
Other than that, looks ok.
Martin