summaryrefslogtreecommitdiff
path: root/builtin-fsck.c
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2009-01-18 03:46:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-01-18 06:37:41 (GMT)
commit3aed2fda6f8233895be0d1142c4c4b407fb692c3 (patch)
treee705444fffcd25bef47cdfef67a40830cf72de65 /builtin-fsck.c
parentbf474e2402e51843e8230c064da6ccfdf3a8ff54 (diff)
downloadgit-3aed2fda6f8233895be0d1142c4c4b407fb692c3.zip
git-3aed2fda6f8233895be0d1142c4c4b407fb692c3.tar.gz
git-3aed2fda6f8233895be0d1142c4c4b407fb692c3.tar.bz2
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>
Diffstat (limited to 'builtin-fsck.c')
-rw-r--r--builtin-fsck.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-fsck.c b/builtin-fsck.c
index 30971ce..aa4b239 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);