Re: [PATCH] cat-file --batch / --batch-check: do not exit if hashes are missing
- From
- Lea Wiemann <lewiemann@gmail.com>
- Date
- Jun 9, 2008, 00:05 UTC
- Message-ID
- <484C73DA.10804@gmail.com>
- In-Reply-To
- <alpine.DEB.1.00.0806090033030.1783@racer>
Johannes Schindelin wrote:
Show 10 quoted lines
> Lea Wiemann wrote:
>> - if (type <= 0)
>> - return 1;
>> + if (type <= 0) {
>> + printf("%s missing\n", obj_name);
>> + fflush(stdout);
>> + return 0;
>> + }
>
> Is it really intended that it returns 0 now?Yes, return 0 causes it to not exit (which is the desired effect, as in documented).
> Further, should it not be an error("%s missin... instead? It is an
> error, isn't it?No, it's not an error. I suggest you read git-cat-file.1 -- getting a response of "<object> missing" (rather than cat-file terminating) if you pass in a non-existent object is the desired behavior, and it happened before for named objects, like "HEAD", but not for full hashes. Now it also happens for full hashes.
-- Lea