{"thread":{"id":"66789","subject":"[PATCH 0/2] t5608: assert that the packs involved really are that large","startedAt":"2026-11-06T12:51:14Z","lastAt":"2026-11-06T15:12:38Z","messageCount":5,"participants":["Kristofer Karlsson via GitGitGadget","Patrick Steinhardt","Kristofer Karlsson"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"557670","messageId":"pull.2299.git.1793969476.gitgitgadget@gmail.com","threadId":"66789","inReplyTo":null,"subject":"[PATCH 0/2] t5608: assert that the packs involved really are that large","fromName":"Kristofer Karlsson via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-11-06T12:51:14Z","receivedAt":"2026-11-06T12:51:14Z","isPatch":true,"sender":{"key":"krka@spotify.com","avatar":"https://avatars.githubusercontent.com/u/5349266?v=4"},"body":"I was looking at which tests take the most time in CI, and t5608 stood out\nwhen (unscientifically) spot-checking a single run. Profiling its setup\nshowed that it does not actually create the >2GB pack that the test's name\npromises. While adding assertions for that, it turned out that the\nunpack-objects variant of the >4GB test never runs unpack-objects either.\n\nOnce it does, it fails on Windows, because unpack-objects narrows the size\nof a streamed blob to \"unsigned long\" on its way to the object writer. The\nfirst patch fixes that.\n\nKristofer Karlsson (2):\n  unpack-objects: pass the size of a streamed blob as size_t\n  t5608: assert that the packs involved really are that large\n\n builtin/unpack-objects.c |  2 +-\n t/t5608-clone-2gb.sh     | 54 ++++++++++++++++++++++++++++++----------\n 2 files changed, 42 insertions(+), 14 deletions(-)\n\n\nbase-commit: 0ffa3e35c7c82ab8d0de226149fb03b3f7674d05\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2299%2Fspkrka%2Ft5608-real-2gb-pack-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2299/spkrka/t5608-real-2gb-pack-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2299\n-- \ngitgitgadget\n\n"},{"id":"557671","messageId":"789bb9bca7f4a1c97cfd7a1062d80698cd3e11fc.1793969476.git.gitgitgadget@gmail.com","threadId":"66789","inReplyTo":"pull.2299.git.1793969476.gitgitgadget@gmail.com","subject":"[PATCH 1/2] unpack-objects: pass the size of a streamed blob as size_t","fromName":"Kristofer Karlsson via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-11-06T12:51:15Z","receivedAt":"2026-11-06T12:51:15Z","isPatch":true,"sender":{"key":"krka@spotify.com","avatar":"https://avatars.githubusercontent.com/u/5349266?v=4"},"body":"From: Kristofer Karlsson <krka@spotify.com>\n\nSince f2063855fb (index-pack, unpack-objects: use size_t for object\nsize, 2026-05-08), unpack_one() decodes the size of an object into a\nsize_t.  But stream_blob(), which is used for blobs larger than\ncore.bigFileThreshold, still takes that size as \"unsigned long\".\nWhere that type is only 32 bits wide, such as on Windows, the size of\na blob larger than 4GB is truncated, and writing the object fails:\n\n  fatal: write stream object 4294967304 != 8\n\nThis was found by the next commit, which makes t5608 actually\nexercise the unpack-objects path for a >4GB blob.\n\nTake the size as size_t instead.  The struct odb_stream it is stored\nin already uses size_t, as does the rest of the path that writes the\nloose object.\n\nSigned-off-by: Kristofer Karlsson <krka@spotify.com>\n---\n builtin/unpack-objects.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c\nindex 351948724a..d2f25bed49 100644\n--- a/builtin/unpack-objects.c\n+++ b/builtin/unpack-objects.c\n@@ -386,7 +386,7 @@ static ssize_t zlib_stream_read(struct odb_stream *in_stream,\n \treturn buf_len - zstream->avail_out;\n }\n \n-static void stream_blob(unsigned long size, unsigned nr)\n+static void stream_blob(size_t size, unsigned nr)\n {\n \tgit_zstream zstream = { 0 };\n \tstruct zlib_stream in_stream = {\n-- \ngitgitgadget\n\n\n"},{"id":"557672","messageId":"6c6abee65cb3987978b982e69f227e408c0bf408.1793969476.git.gitgitgadget@gmail.com","threadId":"66789","inReplyTo":"pull.2299.git.1793969476.gitgitgadget@gmail.com","subject":"[PATCH 2/2] t5608: assert that the packs involved really are that large","fromName":"Kristofer Karlsson via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-11-06T12:51:16Z","receivedAt":"2026-11-06T12:51:16Z","isPatch":true,"sender":{"key":"krka@spotify.com","avatar":"https://avatars.githubusercontent.com/u/5349266?v=4"},"body":"From: Kristofer Karlsson <krka@spotify.com>\n\nt5608 was added in ca31f0b5c2 (Add an (optional, since expensive) test\nfor >2gb clones, 2009-03-06) to construct a repository larger than 2GB\nand clone it.  It already anticipated that the setup might stop doing\nwhat it is meant to do: \"Should that break in the future, e.g. when\npack v4 becomes default, there is a commented-out call to\ntest-genrandom which can be substituted\".\n\nIt did break, silently, with d9545c7f46 (fast-import: implement unpack\nlimit, 2016-04-25).  The setup writes only 24 objects, which is below\nthe default fastimport.unpackLimit of 100, so fast-import does not\nkeep its pack but turns it into loose objects.  Since the blobs\ncompress very well, the repository has less than 10MB of loose\nobjects, and the bare clone merely copies those.  Only the file://\nclone still deals with a pack larger than 2GB, because the sending\nside generates a new pack from the loose objects.\n\nThe \">4GB object\" tests added in 4b220cafbe (t5608: add regression\ntest for >4GB object clone, 2026-05-08) have a similar problem.  They\nare meant to cover a fix in both index-pack and unpack-objects, but\n\"git clone\" always keeps the received pack, so setting\nfetch.unpackLimit in the unpack-objects variant has no effect, and\nboth tests use index-pack.\n\nNothing noticed any of this, because the tests only check that the\ncommands succeed.  Add assertions on what each test relies on, so\nthat it fails when its setup no longer does what it is meant to:\n\n - the pack created by the setup, and the packs of both clones, are\n   larger than 2GB;\n\n - the synthesized pack with the >4GB object, and the pack written by\n   the index-pack clone, are larger than 4GB;\n\n - the unpack-objects variant really runs unpack-objects, as seen in\n   its trace2 output.\n\nSome of these assertions fail with the tests as they are, so fix them:\n\n - Set fastimport.unpackLimit=0 in the setup.  fast-import then\n   keeps its pack regardless of how few objects it contains, so the\n   repository, and the bare clone that copies it, have a pack larger\n   than 2GB again.\n\n - In the unpack-objects variant, use \"git fetch\" into an empty\n   repository instead of \"git clone\".  Unlike clone, fetch honors\n   fetch.unpackLimit, so with five objects and a limit of 100 the\n   received pack really is passed to unpack-objects.\n\nAs a bonus, keeping the fast-import pack also makes the test cheaper,\nbecause unpack-objects no longer hashes and compresses all of the 2GB\nof data a second time.  Locally, the time spent in the setup is\nroughly reduced from 80 to 40 seconds.  The test runs in all CI jobs\nvia GIT_TEST_CLONE_2GB, and is among the slowest tests there.\n\nSigned-off-by: Kristofer Karlsson <krka@spotify.com>\n---\n t/t5608-clone-2gb.sh | 54 +++++++++++++++++++++++++++++++++-----------\n 1 file changed, 41 insertions(+), 13 deletions(-)\n\ndiff --git a/t/t5608-clone-2gb.sh b/t/t5608-clone-2gb.sh\nindex 5d56debf1c..9d7152486e 100755\n--- a/t/t5608-clone-2gb.sh\n+++ b/t/t5608-clone-2gb.sh\n@@ -9,12 +9,28 @@ then\n \ttest_done\n fi\n \n+size_2gb=2147483648\n+size_4gb=4294967296\n+\n+# The tests below are only meaningful if the packs involved really are\n+# that large, so check it explicitly instead of trusting the setup.\n+test_has_pack_larger_than () {\n+\tmax=$(test-tool path-utils file-size \"$1\"/*.pack | sort -n | tail -n 1) &&\n+\tmax=${max:-0} &&\n+\tif test \"$max\" -le \"$2\"\n+\tthen\n+\t\techo >&2 \"largest pack in '$1' is $max bytes, expected more than $2\" &&\n+\t\treturn 1\n+\tfi\n+}\n+\n test_expect_success 'setup' '\n \tgit init 2gb-repo &&\n \t(\n \t\tcd 2gb-repo &&\n \t\tgit config pack.compression 0 &&\n \t\tgit config pack.depth 0 &&\n+\t\tgit config fastimport.unpackLimit 0 &&\n \t\tblobsize=$((100*1024*1024)) &&\n \t\tblobcount=$((2*1024*1024*1024/$blobsize+1)) &&\n \t\ti=1 &&\n@@ -39,14 +55,20 @@ test_expect_success 'setup' '\n \t)\n '\n \n+test_expect_success 'setup produces a pack larger than 2GB' '\n+\ttest_has_pack_larger_than 2gb-repo/.git/objects/pack $size_2gb\n+'\n+\n test_expect_success 'clone - bare' '\n \ttest_when_finished rm -rf clone-bare &&\n-\tgit clone --bare --no-hardlinks 2gb-repo clone-bare\n+\tgit clone --bare --no-hardlinks 2gb-repo clone-bare &&\n+\ttest_has_pack_larger_than clone-bare/objects/pack $size_2gb\n '\n \n test_expect_success 'clone - with worktree, file:// protocol' '\n \ttest_when_finished rm -rf clone-wt &&\n-\tgit clone \"file://$(pwd)/2gb-repo\" clone-wt\n+\tgit clone \"file://$(pwd)/2gb-repo\" clone-wt &&\n+\ttest_has_pack_larger_than clone-wt/.git/objects/pack $size_2gb\n '\n \n rm -rf 2gb-repo 2>/dev/null\n@@ -59,24 +81,29 @@ test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'set up repo with >4GB object' '\n \t\t4gb-repo/objects/pack/test.pack) &&\n \tgit -C 4gb-repo index-pack objects/pack/test.pack &&\n \tgit -C 4gb-repo update-ref refs/heads/main $head_oid &&\n-\tgit -C 4gb-repo symbolic-ref HEAD refs/heads/main\n+\tgit -C 4gb-repo symbolic-ref HEAD refs/heads/main &&\n+\ttest_has_pack_larger_than 4gb-repo/objects/pack $size_4gb\n '\n \n-test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'clone >4GB object via unpack-objects' '\n-\ttest_when_finished rm -rf 4gb-clone-unpack &&\n+test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'fetch >4GB object via unpack-objects' '\n+\ttest_when_finished rm -rf 4gb-fetch-unpack &&\n \t# The synthesized pack has five objects, so a large unpack limit keeps\n-\t# fetch-pack on the unpack-objects path.\n-\tgit -c fetch.unpackLimit=100 clone --bare \\\n-\t\t\"file://$(pwd)/4gb-repo\" 4gb-clone-unpack &&\n+\t# fetch-pack on the unpack-objects path.  This needs \"fetch\", as\n+\t# \"clone\" always keeps the received pack.\n+\tgit init --bare 4gb-fetch-unpack &&\n+\tGIT_TRACE2_EVENT=\"$(pwd)/trace-unpack\" \\\n+\t\tgit -C 4gb-fetch-unpack -c fetch.unpackLimit=100 fetch \\\n+\t\t\"file://$(pwd)/4gb-repo\" main:refs/heads/main &&\n+\ttest_subcommand_flex git unpack-objects <trace-unpack &&\n \n-\t# Verify the large blob survived the clone by comparing its OID\n-\t# between source and clone.  We cannot use \"cat-file -s\" because\n+\t# Verify the large blob survived the fetch by comparing its OID\n+\t# between source and destination.  We cannot use \"cat-file -s\" because\n \t# object_info.sizep is still unsigned long, which truncates >4GB\n \t# sizes on Windows.  OID equality proves content integrity since\n-\t# the clone already verified checksums via index-pack/unpack-objects.\n+\t# the fetch already verified checksums via unpack-objects.\n \tsource_blob=$(git -C 4gb-repo rev-parse main^:file) &&\n-\tclone_blob=$(git -C 4gb-clone-unpack rev-parse main^:file) &&\n-\ttest \"$source_blob\" = \"$clone_blob\"\n+\tfetched_blob=$(git -C 4gb-fetch-unpack rev-parse main^:file) &&\n+\ttest \"$source_blob\" = \"$fetched_blob\"\n '\n \n test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'clone with >4GB object via index-pack' '\n@@ -84,6 +111,7 @@ test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'clone with >4GB object via index-\n \t# Force fetch-pack to hand the pack to index-pack instead.\n \tgit -c fetch.unpackLimit=1 clone --bare \\\n \t\t\"file://$(pwd)/4gb-repo\" 4gb-clone-index &&\n+\ttest_has_pack_larger_than 4gb-clone-index/objects/pack $size_4gb &&\n \n \tsource_blob=$(git -C 4gb-repo rev-parse main^:file) &&\n \tclone_blob=$(git -C 4gb-clone-index rev-parse main^:file) &&\n-- \ngitgitgadget\n\n"},{"id":"557691","messageId":"au3qKLWlM45rByWg@pks.im","threadId":"66789","inReplyTo":"6c6abee65cb3987978b982e69f227e408c0bf408.1793969476.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/2] t5608: assert that the packs involved really are that large","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-11-06T14:54:32Z","receivedAt":"2026-11-06T14:54:32Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, Nov 06, 2026 at 12:51:16PM +0000, Kristofer Karlsson via GitGitGadget wrote:\n> From: Kristofer Karlsson <krka@spotify.com>\n> \n> t5608 was added in ca31f0b5c2 (Add an (optional, since expensive) test\n> for >2gb clones, 2009-03-06) to construct a repository larger than 2GB\n> and clone it.  It already anticipated that the setup might stop doing\n> what it is meant to do: \"Should that break in the future, e.g. when\n> pack v4 becomes default, there is a commented-out call to\n> test-genrandom which can be substituted\".\n> \n> It did break, silently, with d9545c7f46 (fast-import: implement unpack\n> limit, 2016-04-25).  The setup writes only 24 objects, which is below\n> the default fastimport.unpackLimit of 100, so fast-import does not\n> keep its pack but turns it into loose objects.  Since the blobs\n> compress very well, the repository has less than 10MB of loose\n> objects, and the bare clone merely copies those.  Only the file://\n> clone still deals with a pack larger than 2GB, because the sending\n> side generates a new pack from the loose objects.\n> \n> The \">4GB object\" tests added in 4b220cafbe (t5608: add regression\n> test for >4GB object clone, 2026-05-08) have a similar problem.  They\n> are meant to cover a fix in both index-pack and unpack-objects, but\n> \"git clone\" always keeps the received pack, so setting\n> fetch.unpackLimit in the unpack-objects variant has no effect, and\n> both tests use index-pack.\n\nSo this test in particular never exercised what it was designed to?\n\n> Nothing noticed any of this, because the tests only check that the\n> commands succeed.  Add assertions on what each test relies on, so\n> that it fails when its setup no longer does what it is meant to:\n> \n>  - the pack created by the setup, and the packs of both clones, are\n>    larger than 2GB;\n> \n>  - the synthesized pack with the >4GB object, and the pack written by\n>    the index-pack clone, are larger than 4GB;\n> \n>  - the unpack-objects variant really runs unpack-objects, as seen in\n>    its trace2 output.\n\nMakes sense.\n\n> Some of these assertions fail with the tests as they are, so fix them:\n> \n>  - Set fastimport.unpackLimit=0 in the setup.  fast-import then\n>    keeps its pack regardless of how few objects it contains, so the\n>    repository, and the bare clone that copies it, have a pack larger\n>    than 2GB again.\n> \n>  - In the unpack-objects variant, use \"git fetch\" into an empty\n>    repository instead of \"git clone\".  Unlike clone, fetch honors\n>    fetch.unpackLimit, so with five objects and a limit of 100 the\n>    received pack really is passed to unpack-objects.\n\nAnd the preceding patch fixes a third assertion that we'd otherwise have\nseen fail here, I assume?\n\n> As a bonus, keeping the fast-import pack also makes the test cheaper,\n> because unpack-objects no longer hashes and compresses all of the 2GB\n> of data a second time.  Locally, the time spent in the setup is\n> roughly reduced from 80 to 40 seconds.  The test runs in all CI jobs\n> via GIT_TEST_CLONE_2GB, and is among the slowest tests there.\n\nNice.\n\n> diff --git a/t/t5608-clone-2gb.sh b/t/t5608-clone-2gb.sh\n> index 5d56debf1c..9d7152486e 100755\n> --- a/t/t5608-clone-2gb.sh\n> +++ b/t/t5608-clone-2gb.sh\n> @@ -9,12 +9,28 @@ then\n>  \ttest_done\n>  fi\n>  \n> +size_2gb=2147483648\n> +size_4gb=4294967296\n> +\n> +# The tests below are only meaningful if the packs involved really are\n> +# that large, so check it explicitly instead of trusting the setup.\n> +test_has_pack_larger_than () {\n> +\tmax=$(test-tool path-utils file-size \"$1\"/*.pack | sort -n | tail -n 1) &&\n> +\tmax=${max:-0} &&\n> +\tif test \"$max\" -le \"$2\"\n> +\tthen\n> +\t\techo >&2 \"largest pack in '$1' is $max bytes, expected more than $2\" &&\n> +\t\treturn 1\n> +\tfi\n> +}\n> +\n>  test_expect_success 'setup' '\n>  \tgit init 2gb-repo &&\n>  \t(\n>  \t\tcd 2gb-repo &&\n>  \t\tgit config pack.compression 0 &&\n>  \t\tgit config pack.depth 0 &&\n> +\t\tgit config fastimport.unpackLimit 0 &&\n>  \t\tblobsize=$((100*1024*1024)) &&\n>  \t\tblobcount=$((2*1024*1024*1024/$blobsize+1)) &&\n>  \t\ti=1 &&\n> @@ -39,14 +55,20 @@ test_expect_success 'setup' '\n>  \t)\n>  '\n>  \n> +test_expect_success 'setup produces a pack larger than 2GB' '\n> +\ttest_has_pack_larger_than 2gb-repo/.git/objects/pack $size_2gb\n> +'\n\nNit, not worth a reroll: I would have folded this into the test itself.\n\n> @@ -59,24 +81,29 @@ test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'set up repo with >4GB object' '\n>  \t\t4gb-repo/objects/pack/test.pack) &&\n>  \tgit -C 4gb-repo index-pack objects/pack/test.pack &&\n>  \tgit -C 4gb-repo update-ref refs/heads/main $head_oid &&\n> -\tgit -C 4gb-repo symbolic-ref HEAD refs/heads/main\n> +\tgit -C 4gb-repo symbolic-ref HEAD refs/heads/main &&\n> +\ttest_has_pack_larger_than 4gb-repo/objects/pack $size_4gb\n>  '\n>  \n> -test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'clone >4GB object via unpack-objects' '\n> -\ttest_when_finished rm -rf 4gb-clone-unpack &&\n> +test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'fetch >4GB object via unpack-objects' '\n> +\ttest_when_finished rm -rf 4gb-fetch-unpack &&\n>  \t# The synthesized pack has five objects, so a large unpack limit keeps\n> -\t# fetch-pack on the unpack-objects path.\n> -\tgit -c fetch.unpackLimit=100 clone --bare \\\n> -\t\t\"file://$(pwd)/4gb-repo\" 4gb-clone-unpack &&\n> +\t# fetch-pack on the unpack-objects path.  This needs \"fetch\", as\n> +\t# \"clone\" always keeps the received pack.\n\nThis is a bit of a surprise to me, I thought that it would apply to both\ngit-clone(1) and git-fetch(1). Did you by any chance check whether this\nis intentional or whteher it's another bug?\n\n> +\tgit init --bare 4gb-fetch-unpack &&\n> +\tGIT_TRACE2_EVENT=\"$(pwd)/trace-unpack\" \\\n> +\t\tgit -C 4gb-fetch-unpack -c fetch.unpackLimit=100 fetch \\\n> +\t\t\"file://$(pwd)/4gb-repo\" main:refs/heads/main &&\n> +\ttest_subcommand_flex git unpack-objects <trace-unpack &&\n>  \n> -\t# Verify the large blob survived the clone by comparing its OID\n> -\t# between source and clone.  We cannot use \"cat-file -s\" because\n> +\t# Verify the large blob survived the fetch by comparing its OID\n> +\t# between source and destination.  We cannot use \"cat-file -s\" because\n>  \t# object_info.sizep is still unsigned long, which truncates >4GB\n>  \t# sizes on Windows.  OID equality proves content integrity since\n> -\t# the clone already verified checksums via index-pack/unpack-objects.\n> +\t# the fetch already verified checksums via unpack-objects.\n>  \tsource_blob=$(git -C 4gb-repo rev-parse main^:file) &&\n> -\tclone_blob=$(git -C 4gb-clone-unpack rev-parse main^:file) &&\n> -\ttest \"$source_blob\" = \"$clone_blob\"\n> +\tfetched_blob=$(git -C 4gb-fetch-unpack rev-parse main^:file) &&\n> +\ttest \"$source_blob\" = \"$fetched_blob\"\n>  '\n\nOther than that this looks good to me, thanks.\n\nPatrick\n\n"},{"id":"557693","messageId":"CAL71e4PmJ1an8jwJNRGmU9w_HAM7WHC0Xk3rMKqQFxB_KNTA0g@mail.gmail.com","threadId":"66789","inReplyTo":"au3qKLWlM45rByWg@pks.im","subject":"Re: [PATCH 2/2] t5608: assert that the packs involved really are that large","fromName":"Kristofer Karlsson","fromEmail":"krka@spotify.com","sentAt":"2026-11-06T15:12:38Z","receivedAt":"2026-11-06T15:12:38Z","isPatch":true,"sender":{"key":"krka@spotify.com","avatar":"https://avatars.githubusercontent.com/u/5349266?v=4"},"body":"On Fri, 6 Nov 2026 at 15:54, Patrick Steinhardt <ps@pks.im> wrote:\n>\n> > The \">4GB object\" tests added in 4b220cafbe (t5608: add regression\n> > test for >4GB object clone, 2026-05-08) have a similar problem.  They\n> > are meant to cover a fix in both index-pack and unpack-objects, but\n> > \"git clone\" always keeps the received pack, so setting\n> > fetch.unpackLimit in the unpack-objects variant has no effect, and\n> > both tests use index-pack.\n>\n> So this test in particular never exercised what it was designed to?\n\nYes, I think that's the case (though I could be wrong about it).\nIn any case, I think regardless of if it was broken from the\nstart or not, it makes sense to ensure it can't be silently\nbroken by any other future optimization that shrinks the\npack file sizes.\n\n> And the preceding patch fixes a third assertion that we'd otherwise have\n> seen fail here, I assume?\n\nExactly, I would have preferred to just send the test\nimprovement but it turned out that fixing the problem\nwas easier than making the test more flexible, so I\nadded that as a prerequisite patch.\n\n> > +test_expect_success 'setup produces a pack larger than 2GB' '\n> > +     test_has_pack_larger_than 2gb-repo/.git/objects/pack $size_2gb\n> > +'\n>\n> Nit, not worth a reroll: I would have folded this into the test itself.\n\nI did consider that, but figured this was not too much\noverhead, and made it slightly easier to read.\nThat said, if I need to reroll for other reasons,\nI can definitely inline it into the setup instead.\n\n> > +     # fetch-pack on the unpack-objects path.  This needs \"fetch\", as\n> > +     # \"clone\" always keeps the received pack.\n>\n> This is a bit of a surprise to me, I thought that it would apply to both\n> git-clone(1) and git-fetch(1). Did you by any chance check whether this\n> is intentional or whteher it's another bug?\n\nIt appears to be intentional (and old). In the commit ad89721508\n(fetch-pack: -k option to keep downloaded pack., 2005-12-14) says:\n\n  We earlier had something like that on clone-pack side once, but\n  the list discussion resulted in the decision that it makes sense\n  to always keep the pack for clone-pack, so unpacking option is\n  not enabled on the clone-pack side, [...]\n\nand the builtin clone kept that behaviour by always setting\nTRANS_OPT_KEEP, since 8434c2f1af (Build in clone, 2008-04-27).\nSo the unpack limits have only ever applied to fetch.\n\n> Other than that this looks good to me, thanks.\n>\n> Patrick\n\nThanks for the review!\nKristofer\n\n"}]}