RE: [PATCH v2 3/3] archive: support remote archive from stateless transport
- From
rsbecker@nexbridge.com <rsbecker@nexbridge.com>
- Date
- Sep 25, 2023, 01:04 UTC
- Message-ID
- <007b01d9ef4c$4c4e8eb0$e4ebac10$@nexbridge.com>
- In-Reply-To
- <CANYiYbGf4U2_UG674GqfauNPg+TgOtzRT=xCJ=x0gHM+TcrNpQ@mail.gmail.com>
On Sunday, September 24, 2023 8:16 PM, Jiang Xin wrote:
Show 44 quoted lines
>On Mon, Sep 25, 2023 at 7:58 AM <rsbecker@nexbridge.com> wrote:
>>
>> On Sunday, September 24, 2023 7:40 PM, Jiang Xin wrote:
>> >On Sun, Sep 24, 2023 at 2:52 PM Eric Sunshine
>> ><sunshine@sunshineco.com>
>> >wrote:
>> >>
>> >> On Sat, Sep 23, 2023 at 11:22 AM Jiang Xin <worldhello.net@gmail.com>
>wrote:
>> >> > Even though we can establish a stateless connection, we still
>> >> > cannot archive the remote repository using a stateless HTTP
>> >> > protocol. Try the following steps to make it work.
>> >> > [...]
>> >> > Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
>> >> > ---
>> >> > diff --git a/http-backend.c b/http-backend.c @@ -639,10 +640,19
>> >> > @@ static void check_content_type(struct strbuf *hdr, const char
>*accepted_type)
>> >> > - const char *argv[] = {NULL, "--stateless-rpc", ".", NULL};
>> >> > + const char *argv[4];
>> >> >
>> >> > + if (!strcmp(service_name, "git-upload-archive")) {
>> >> > + argv[1] = ".";
>> >> > + argv[2] = NULL;
>> >> > + } else {
>> >> > + argv[1] = "--stateless-rpc";
>> >> > + argv[2] = ".";
>> >> > + argv[3] = NULL;
>> >> > + }
>> >>
>> >> It may not be worth a reroll, but since you're touching this code
>> >> anyhow, these days we'd use `strvec` for this:
>> >>
>> >> struct strvec argv = STRVEC_INIT;
>> >> if (strcmp(service_name, "git-upload-archive"))
>> >> strvec_push(&argv, "--stateless-rpc");
>> >> strvec_push(&argv, ".");
>> >
>> >Good suggestion, I'll queue this up as part of next reroll.
>>
>> Which test covers this change?
>
>See: https://lore.kernel.org/git/20230923152201.14741-4-
>worldhello.net@gmail.com/#Z31t:t5003-archive-zip.shThanks. That is what I needed. Looking forward to the merge. --Randall