Re: [PATCH] Fix git-fsck-cache segfault on invalid tag
- From
Junio C Hamano <junkio@cox.net>
- Date
- May 20, 2005, 13:58 UTC
- Message-ID
- <7voeb6uhhs.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20050520085047.GA27787@pasky.ji.cz>
>>>>> "PB" == Petr Baudis <pasky@ucw.cz> writes:
Show 6 quoted lines
>> obj = lookup_object(sha1);
>> + if (!obj) {
>> + fprintf(stderr, "invalid tag %s - %s\n", path, hexname);
>> + return;
>> + }
>> ...PB> My error message is PB> error("%s: invalid sha1 pointer %.40s", path, hexname); PB> I'd prefer that (at least use the error() call).
Ack.
I was about to say "doesn't lookup_object() give its own error message before you say that, though?" because I remembered a comment to that effect around ll 410 that gets the heads from the command line argument, and then looked at lookup_object() implementation to find that it does _not_ give error message.
So if you are going to do this, would you mind giving similar error message to that command line heads stuff while you are at it, please?