diff options
author | Jeff King <peff@peff.net> | 2017-06-05 15:15:25 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-07 07:45:59 +0900 |
commit | 7c2115aa0790fc88bb7c8882f54a7d90c2535e02 (patch) | |
tree | 7060b96d7e4de03b5ff155608b8dfa143e30b093 /t/t5100/msg0002 | |
parent | sha1_file.c: mark strings for translation (diff) | |
download | tgif-7c2115aa0790fc88bb7c8882f54a7d90c2535e02.tar.xz |
t5313: make extended-table test more deterministic
Commit a1283866b (t5313: test bounds-checks of
corrupted/malicious pack/idx files, 2016-02-25) added a test
that requires our corrupted pack index to have two objects.
The entry for the first one remains untouched, but we
corrupt the entry for second one. Since the index stores the
entries in sha1-sorted order, this means that the test must
make sure that the sha1 of the object we expect to be
corrupted ("$object") sorts after the other placeholder
object.
That commit used the HEAD commit as the placeholder, but the
script never calls test_tick. That means that the commit
object (and thus its sha1) depends on the timestamp when the
test script is run. This usually works in practice, because
the sha1 of $object starts with "fff". The commit object
will sort after that only 1 in 4096 times, but when it does
the test will fail.
One obvious solution is to add the test_tick call to get a
deterministic commit sha1. But since we're relying on the
sort order for the test to function, let's make that very
explicit by just generating a second blob with a known sha1.
Reported-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5100/msg0002')
0 files changed, 0 insertions, 0 deletions