Re: [PATCH 22/44] fetch-pack: parse and advertise the object-format capability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 13 May 2020 at 02:56, brian m. carlson
<sandals@xxxxxxxxxxxxxxxxxxxx> 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux