Re: [PATCH] unpack-trees.c: fix writing "link" index ext with null base oid
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Feb 12, 2019, 09:36 UTC
- Message-ID
- <8736otl56m.fsf@evledraar.gmail.com>
- In-Reply-To
- <20190209112328.26317-1-pclouds@gmail.com>
On Sat, Feb 09 2019, Nguyễn Thái Ngọc Duy wrote:
I ran into this bug in the past but wasn't able to reproduce it long enough to track it down. Thanks for the fix.
It would be nice to have a test for it if it's easily narrowed down, tricky edge cases we fix are worth testing for...
> I considered adding a test, but since the problem is a warning, not > sure how to catch that. And a test would not be able to verify all > changes in this patch anyway.
You'd write the test like this:
git [...] 2>stderr &&
test_i18ngrep "could not.*000000000" stderrOr something like that. We have a lot of tests like this already, some can be found with:
git grep -B1 test_i18ngrep.*stderr
So something being a warning shouldn't stop us from testing for it.