From: Christian Couder <chriscool@tuxfamily.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH] builtin-fsck: fix off by one head count
Date: Sun, 18 Jan 2009 18:27:14 +0100 [thread overview]
Message-ID: <20090118182714.78422d0e.chriscool@tuxfamily.org> (raw)
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.
But before this patch, when it was passed only one head, then it
behaved as if no heads were passed (that is it used the index file,
all references in $GIT_DIR/refs/* and all reflogs). In fact it just
ignored the first head it was passed.
It looks like this bug was introduced when "builtin-fsck.c" was
changed to use "parse_options" (commit
5ac0a2063e8f824f6e8ffb4d18de74c55aae7131).
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
builtin-fsck.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Sorry if you receive this patch more than once, but it
seems that something did not work when I tried to send
it to the mailing list before.
diff --git a/builtin-fsck.c b/builtin-fsck.c
index 5a08ec1..fb35554 100644
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
@@ -629,7 +629,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);
--
1.6.1.85.g8ffc
reply other threads:[~2009-01-18 17:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090118182714.78422d0e.chriscool@tuxfamily.org \
--to=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).