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>
Christian Couder committed
Jan 18, 2009 at 04:46 UTC
3aed2fda6f8233895be0d1142c4c4b407fb692c3
1 file changed
+1
-1
builtin-fsck.c
+1
-1
@@ -624,7 +624,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
624
}
625
626
heads = 0;
627
- for (i = 1; i < argc; i++) {
627
+ for (i = 0; i < argc; i++) {
628
const char *arg = argv[i];
629
if (!get_sha1(arg, head_sha1)) {
630
struct object *obj = lookup_object(head_sha1);