]> git.ipfire.org Git - thirdparty/git.git/commit - t/t5318-commit-graph.sh
commit-graph: verify catches corrupt signature
authorDerrick Stolee <dstolee@microsoft.com>
Wed, 27 Jun 2018 13:24:33 +0000 (09:24 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Jun 2018 17:27:05 +0000 (10:27 -0700)
commitd9b9f8a6fd146ee1069e1cc4cf16eba76bdc1e08
tree19f042cf65de94862d65348ca23e0bdfa68761a2
parent283e68c72f49e6cfbae53cb5547d5b399ed25d1a
commit-graph: verify catches corrupt signature

This is the first of several commits that add a test to check that
'git commit-graph verify' catches corruption in the commit-graph
file. The first test checks that the command catches an error in
the file signature. This is a check that exists in the existing
commit-graph reading code.

Add a helper method 'corrupt_graph_and_verify' to the test script
t5318-commit-graph.sh. This helper corrupts the commit-graph file
at a certain location, runs 'git commit-graph verify', and reports
the output to the 'err' file. This data is filtered to remove the
lines added by 'test_must_fail' when the test is run verbosely.
Then, the output is checked to contain a specific error message.

Most messages from 'git commit-graph verify' will not be marked
for translation. There will be one exception: the message that
reports an invalid checksum will be marked for translation, as that
is the only message that is intended for a typical user.

Helped-by: Szeder Gábor <szeder.dev@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5318-commit-graph.sh