From c6c7b16d23a4cb6af26acee865c2ade1a3822bef Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 16 Jan 2017 16:33:29 -0500 Subject: fsck: tighten error-checks of "git fsck " Instead of checking reachability from the refs, you can ask fsck to check from a particular set of heads. However, the error checking here is quite lax. In particular: 1. It claims lookup_object() will report an error, which is not true. It only does a hash lookup, and the user has no clue that their argument was skipped. 2. When either the name or sha1 cannot be resolved, we continue to exit with a successful error code, even though we didn't check what the user asked us to. This patch fixes both of these cases. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t1450-fsck.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 't/t1450-fsck.sh') diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index 4d1c3ba66..6b6db62c4 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -611,4 +611,9 @@ test_expect_success 'fsck notices dangling objects' ' ) ' +test_expect_success 'fsck $name notices bogus $name' ' + test_must_fail git fsck bogus && + test_must_fail git fsck $_z40 +' + test_done -- cgit v1.2.1