Re: [PATCH 15/44] builtin/receive-pack: detect when the server doesn't support our hash

[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:
> +                       const char *hash;
> +                       int len = 0;

Micronit: These new variables are used in tandem. I could see these as
"NULL, 0" or both uninitialized, but this is a mixture. That's a really
small nit, of course. (Maybe you needed to fight a compiler warning?)

> +                       hash = parse_feature_value(feature_list, "object-format", &len, NULL);
> +                       if (!hash) {
> +                               hash = hash_algos[GIT_HASH_SHA1].name;
> +                               len = strlen(hash);
> +                       }
> +                       if (xstrncmpz(the_hash_algo->name, hash, len))
> +                               die("error: unsupported object format '%s'", hash);

Ok, this is a familiar pattern by now: if we get nothing, behave as if
we got SHA-1.


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