Re: [PATCH 11/44] send-pack: detect when the server doesn't support our hash
- From
- Martin Ågren <martin.agren@gmail.com>
- Date
- May 13, 2020, 19:41 UTC
- Message-ID
- <CAN0heSqvy_y7tNkfs_499vfYL6iOvE6nH5s_42WOHAT-5iSgUQ@mail.gmail.com>
- In-Reply-To
- <20200513005424.81369-12-sandals@crustytoothpaste.net>
On Wed, 13 May 2020 at 02:58, brian m. carlson <sandals@crustytoothpaste.net> wrote:
> > Detect when the server doesn't support our hash algorithm and abort.
> + if (!server_supports_hash(the_hash_algo->name, &object_format_supported))
> + die(_("the receiving end does not support this repository's hash algorithm"));I suppose this isn't the long-term wanted behavior? Would this be where we would later learn to realize that "oh, crap, we need to convert/translate on the fly"?
Show 6 quoted lines
> @@ -428,6 +432,8 @@ int send_pack(struct send_pack_args *args, > strbuf_addstr(&cap_buf, " atomic"); > if (use_push_options) > strbuf_addstr(&cap_buf, " push-options"); > + if (object_format_supported) > + strbuf_addf(&cap_buf, " object-format=%s", the_hash_algo->name);
This isn't advertised in the log message: If we do detect support, go on to reply with our choice of object format / hash algo name.
Martin