Re: git cat-file -e behavior
- From
Michal Čihař <michal@cihar.com>
- Date
- Feb 29, 2016, 12:16 UTC
- Message-ID
- <56D436A2.4090202@cihar.com>
- In-Reply-To
- <20160229114455.GD29769@sigill.intra.peff.net>
Hi
Dne 29.2.2016 v 12:44 Jeff King napsal(a):
Show 6 quoted lines
> It looks like it has been this way forever. The first thing we do with > the object is resolve its name to a sha1, and that's where the error you > see comes from. And then we actually check whether we have the object. > > I think the intended use was to feed it a sha1 to see if it exists. Then > the name-resolution step is a noop.
I found this as best way to check whether file exists in branch. Checking git ls-tree output seems less error prone than checking return value of git cat-file -e...
> I'm not sure if the behavior you are seeing is all that bad (the > documentation could be read as suppressing the normal stdout output, but > error messages remain),
I understand this, that's why I'm asking whether it's expected output or not :-).
-- Michal Čihař | http://cihar.com | http://blog.cihar.com