fetch test: use more robust test for filtered objects
commit07ef3c6604c7c3da4b7279cd725cf8e5e0cf7edd
authorJonathan Nieder <jrnieder@gmail.com>
Tue, 24 Dec 2019 00:59:07 +0000 (23 16:59 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Jan 2020 22:03:55 +0000 (15 14:03 -0800)
tree067b54c676cb9c065ea249f0f0544578e5925e9a
parentd6509da620feb774dce6de9fe71d38fef9f07c88
fetch test: use more robust test for filtered objects

"git cat-file -e" uses has_object_file, which can fetch from promisor
remotes when an object is missing.  These tests end up checking that
that fetch fails instead of for the object being missing.

By luck, the tests pass anyway:

- in one of these tests ("filtering by size"), the fetch fails because
  (in protocol v0) the server does not support fetches by SHA-1

- in the second, the object is present but the test could pass even if
  it weren't if the fetch succeeds

- in the third, the test sets extensions.partialClone to "arbitrary
  string" so that when it tries to fetch, it looks up the "arbitrary
  string" remote which does not exist

Use "git rev-list --objects --missing=allow-any", so that the tests
pass for the right reason.

Noticed while testing with protocol v2, which allows fetching by sha1
by default, causing the first fetch to succeed and the test to fail.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5500-fetch-pack.sh