1
0
mirror of https://github.com/git/git synced 2024-07-05 00:58:49 +00:00

builtin-fsck: fix off by one head count

According to the man page, if "git fsck" is passed one or more heads, it
should verify connectivity and validity of only objects reachable from the
heads it is passed.

However, since 5ac0a20 (Make builtin-fsck.c use parse_options.,
2007-10-15) the command behaved as if no heads were passed, when given
only one argument.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Christian Couder 2009-01-18 04:46:09 +01:00 committed by Junio C Hamano
parent bf474e2402
commit 3aed2fda6f

View File

@ -624,7 +624,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
}
heads = 0;
for (i = 1; i < argc; i++) {
for (i = 0; i < argc; i++) {
const char *arg = argv[i];
if (!get_sha1(arg, head_sha1)) {
struct object *obj = lookup_object(head_sha1);