diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-05-23 14:39:54 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-05-23 14:39:54 -0700 |
| commit | 1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e (patch) | |
| tree | ea4841ac780e199292b086cb8d1322f2b5bbc6be /t/t1450-fsck.sh | |
| parent | ea78f9ee7a595d9e85195c0802d9170fe4ce442e (diff) | |
| parent | 7c898554d7a80e5d70ee8816a23dc425d2f1729c (diff) | |
| download | git-1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e.tar.gz | |
Merge branch 'ab/valgrind-fixes'
A bit of test framework fixes with a few fixes to issues found by
valgrind.
* ab/valgrind-fixes:
commit-graph.c: don't assume that stat() succeeds
object-file: fix a unpack_loose_header() regression in 3b6a8db3b03
log test: skip a failing mkstemp() test under valgrind
tests: using custom GIT_EXEC_PATH breaks --valgrind tests
Diffstat (limited to 't/t1450-fsck.sh')
| -rwxr-xr-x | t/t1450-fsck.sh | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index de50c0ea01..ab7f31f1dc 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -774,10 +774,19 @@ test_expect_success 'fsck finds problems in duplicate loose objects' ' # no "-d" here, so we end up with duplicates git repack && # now corrupt the loose copy - file=$(sha1_file "$(git rev-parse HEAD)") && + oid="$(git rev-parse HEAD)" && + file=$(sha1_file "$oid") && rm "$file" && echo broken >"$file" && - test_must_fail git fsck + test_must_fail git fsck 2>err && + + cat >expect <<-EOF && + error: inflate: data stream error (incorrect header check) + error: unable to unpack header of $file + error: $oid: object corrupt or missing: $file + EOF + grep "^error: " err >actual && + test_cmp expect actual ) ' |
