Re: [PATCH] ref-filter: don't look for objects when outside of a repository
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 25, 2018, 20:57 UTC
- Message-ID
- <xmqq5zytpa65.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180924212034.GF27036@localhost>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 5 quoted lines
> However, if we go for a more informative error message, then wouldn't > it be better to add this condition in populate_value() before it even > calls get_object()? Then we could also add the problematic format > specifier to the error message (I think, but didn't actually check), > just in case someone specified multiple sort keys.
Even though I suspect that verify_ref_format() is the logically the right place to do this (after all, it is about seeing if the format makes sense, and a format that requires an object access used outside a repository should trigger an verification error), doing that in populate_value() probably strikes the best balance, I would think.