t9210: do not rely on lazy fetching to fail

With "rev-list --missing=print $start", where "$start" is a 40-hex object name, the object may or may not be lazily fetched from the promisor. Make sure it fails by forcing dereference of "$start" at that point. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Feb 8, 2024 at 15:15 UTC 75389e275c288a328272b70e841ada767313a739
1 file changed +8 -1
t/t9210-scalar.sh
+8 -1
@@ -154,7 +154,14 @@ test_expect_success 'scalar clone' '
154 test_cmp expect actual &&
155
156 test_path_is_missing 1/2 &&
157 - test_must_fail git rev-list --missing=print $second &&
157 +
158 + # This relies on the fact that the presence of "--missing"
159 + # on the command line forces lazy fetching off before
160 + # "$second^{blob}" gets parsed. Without "^{blob}", a
161 + # bare object name "$second" is taken into the queue and
162 + # the command may not fail with a fixed "rev-list --missing".
163 + test_must_fail git rev-list --missing=print "$second^{blob}" -- &&
164 +
165 git rev-list $second &&
166 git cat-file blob $second >actual &&
167 echo "second" >expect &&