git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] bundle-uri.c: Fix double increment in depth

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jun 21, 2024, 17:17 UTC
Message-ID
<CAPig+cQ7y61LZW9zDMiHLmyEm=DLcBsuR_yPOzXiK6y9iXazWw@mail.gmail.com>
In-Reply-To
<20240621092258.1557258-1-toon@iotcl.com>
On Fri, Jun 21, 2024 at 5:23 AM Toon Claes <toon@iotcl.com> wrote:
Show 31 quoted lines
> A bundle URI can serve a gitformat-bundle(5) or a bundle list. This
> plain text file is in the Git config format containing other bundle
> URIs. To avoid these bundle lists to nest too deep, we've set a limit
> with `max_bundle_uri_depth`. Although, when walk through the tree of
> bundles, the current depth is incremented in download_bundle_list() and
> then calls download_bundle_to_file(), which also increments the depth.
> Remove the increment in download_bundle_to_file().
>
> Signed-off-by: Toon Claes <toon@iotcl.com>
> ---
> diff --git a/t/t5558-clone-bundle-uri.sh b/t/t5558-clone-bundle-uri.sh
> @@ -259,6 +259,68 @@ test_expect_success 'clone bundle list (file, any mode, all failures)' '
> +test_expect_success 'clone bundle list (file, above max depth)' '
> +       cat >bundle-list-1 <<-EOF &&
> +       [bundle]
> +               version = 1
> +               mode = any
> +
> +       [bundle "bundle-list-2"]
> +               uri = file://$(pwd)/bundle-list-2
> +       EOF
> +
> +       cat >bundle-list-2 <<-EOF &&
> +       [bundle]
> +               version = 1
> +               mode = any
> +
> +       [bundle "bundle-list-3"]
> +               uri = file://$(pwd)/bundle-list-3
> +       EOF
> + [...]
A very minor (and subjective) comment beyond those offered by other reviewers...
The above "setup" functionality can be collapsed to:
    for i in $(test_seq 4)
    do
        cat >bundle-list-$i <<-EOF || return 1
        [bundle]
            version = 1
            mode = any
        [bundle "bundle-list-$(($i + 1))"]
            uri = file://$(pwd)/bundle-list-$(($i + 1))
        EOF
    done
Previous: Junio C Hamano
Message 4 of 4 in “bundle-uri.c: Fix double increment in depth”
  1. bundle-uri.c: Fix double increment in depthToon Claes, Jun 21, 2024
  2. Christian CouderJun 21, 2024
  3. Junio C HamanoJun 21, 2024
  4. Eric SunshineJun 21, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.