Re: [PATCH] object-file: avoid ODB transaction when not writing objects
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 7, 2026, 21:43 UTC
- Message-ID
- <xmqqjyui30rf.fsf@gitster.g>
- In-Reply-To
- <20260407212930.GA1315247@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 21 quoted lines
>> diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh >> index c824c1a25c..c1dbc6359a 100755 >> --- a/t/t1517-outside-repo.sh >> +++ b/t/t1517-outside-repo.sh >> @@ -93,6 +93,14 @@ test_expect_success 'diff outside repository' ' >> test_cmp expect actual >> ' >> >> +test_expect_success 'diff files exceeding bigFileThreshold outside repository' ' >> + cd non-repo && >> + echo foo >foo && >> + echo bar >bar && >> + test_must_fail git -c core.bigFileThreshold=1 diff -- foo bar >actual && >> + test_grep "diff --git a/foo b/bar" actual >> +' > > This does a "cd" outside of a sub-shell, which affects all of the > subsequent tests. > > We also are already using the "nongit" wrapper in this script, so it > could be used here.
Yup, the non-repo being somehow outside any repository is also used in the test immediately above this one, so I am inclined to say that we can just enclose the whole thing inside a subshell.
> Thought it was found originally with diff, the bug can also be > demonstrated with just hash-object, which does make the test a little > simpler.
Yeah, that is true, too.