From: Martin Ă…gren Date: Sat, 16 May 2020 11:03:10 GMT Subject: Re: [PATCH 22/44] fetch-pack: parse and advertise the object-format capability Message-ID: In-Reply-To: <20200513005424.81369-23-sandals@crustytoothpaste.net> On Wed, 13 May 2020 at 02:56, brian m. carlson wrote: > > Parse the server's object-format capability and respond accordingly, > dying if there is a mismatch. > + if (server_feature_v2("object-format", &hash_name)) { > + int hash_algo = hash_algo_by_name(hash_name); > + if (hash_algo_by_ptr(the_hash_algo) != hash_algo) > + die(_("mismatched algorithms: client %s; server %s"), > + the_hash_algo->name, hash_name); > + packet_write_fmt(fd_out, "object-format=%s", the_hash_algo->name); > + } > + else if (hash_algo_by_ptr(the_hash_algo) != GIT_HASH_SHA1) > + die(_("the server does not support algorithm '%s'"), > + the_hash_algo->name); Micronit: "} else if (...) {", i.e., join to one line and add braces. Martin