]> git.ipfire.org Git - thirdparty/git.git/commit - builtin-fsck.c
fsck: exit with non-zero status upon errors
authorJunio C Hamano <junkio@cox.net>
Mon, 5 Mar 2007 08:22:06 +0000 (00:22 -0800)
committerJunio C Hamano <junkio@cox.net>
Mon, 5 Mar 2007 08:55:19 +0000 (00:55 -0800)
commite2b4f63512357d83f1f11bafadb22063e5d56621
tree9c928aa80c1e3c565f8ee14a9074dea38efeba46
parent7efbff7531af4281487d54c1dc1401308d988e33
fsck: exit with non-zero status upon errors

git-fsck always exited with status 0, which was a bit sloppy.
This makes it exit with a non-zero status when errors are
found.  The error code is an OR'ed result of:

  1 if corrupted objects are found.
  2 if objects that are ought to be reachable are missing or corrupt.

For example, it would exit with 1 in a repository with an
unreachable corrupt object.  If a tree object of the HEAD commit
is corrupt, you would get 3.

Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-fsck.c