From: Christian Couder Date: Sun, 18 Jan 2009 03:46:09 +0000 (+0100) Subject: builtin-fsck: fix off by one head count X-Git-Tag: v1.6.1.1~10^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3aed2fda6f8233895be0d1142c4c4b407fb692c3;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/builtin-fsck.c b/builtin-fsck.c index 30971ce0a..aa4b239e4 100644 --- a/builtin-fsck.c +++ b/builtin-fsck.c @@ -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);