]> git.ipfire.org Git - thirdparty/git.git/commit - t/t1450-fsck.sh
fsck: tighten error-checks of "git fsck <head>"
authorJeff King <peff@peff.net>
Mon, 16 Jan 2017 21:33:29 +0000 (16:33 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Jan 2017 22:24:33 +0000 (14:24 -0800)
commitc6c7b16d23a4cb6af26acee865c2ade1a3822bef
treebb5f8e6c2b63ecbab751c3feab361db7f68325d9
parent3e3f8bd608e6682a2ad4f6cef52ed8ec45b8ad59
fsck: tighten error-checks of "git fsck <head>"

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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsck.c
t/t1450-fsck.sh