Skip to content

Commit 9dad83b

Browse files
committed
t1450: the order the objects are checked is undefined
When a tag T points at an object X that is of a type that is different from what the tag records as, fsck should report it as an error. However, depending on the order X and T are checked individually, the actual error message can be different. If X is checked first, fsck remembers X's type and then when it checks T, it notices that T records X as a wrong type (i.e. the complaint is about a broken tag T). If T is checked first, on the other hand, fsck remembers that we need to verify X is of the type tag records, and when it later checks X, it notices that X is of a wrong type (i.e. the complaint is about a broken object X). The important thing is that fsck notices such an error and diagnoses the issue on object X, but the test was expecting that we happen to check objects in the order to make us detect issues with tag T, not with object X. Remove this unwarranted assumption. Signed-off-by: Junio C Hamano <[email protected]>
1 parent c6a13b2 commit 9dad83b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

t/t1450-fsck.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ test_expect_success 'tag pointing to something else than its type' '
177177
test_when_finished "remove_object $tag" &&
178178
echo $tag >.git/refs/tags/wrong &&
179179
test_when_finished "git update-ref -d refs/tags/wrong" &&
180-
test_must_fail git fsck --tags 2>out &&
181-
cat out &&
182-
grep "error in tag.*broken links" out
180+
test_must_fail git fsck --tags
183181
'
184182

185183
test_expect_success 'cleaned up' '

0 commit comments

Comments
 (0)