ref-filter: fix double free when an object is missing
git for-each-ref --format='%(*objectname)' aborts with a double free when a ref points to a missing object and an annotated tag sorts before it. This patch resets oi->content at the start of get_object(), so the command fails with fatal: missing object … instead. The test is in t6301-for-each-ref-errors.sh, next to the existing missing-object test.
We hit this on GitLab.com: FindAllTags crashed, and the Tags page showed "Gitaly is not available".
The bug first shipped in v2.53.0, so I plan to base the upstream patch on maint, where the hunk is the same. I'd like a review here before I send it to the list.
I tested with a SANITIZE=address,undefined build on macOS. Without the fix, the new test fails with an ASan double free. With the fix, t6300, t6301, t6302, t1461, t7004 and t3203 pass on both the files and reftable backends.
Closes #829