And to clarify:

On 2017-01-20 20:26, Vladimir Panteleev wrote:
On 2017-01-20 19:03, Junio C Hamano wrote:
Having said all that, using --verify on HEAD does not make much
sense, because if HEAD is missing in .git/, I do not think Git
considers that directory as a Git repository to begin with.

The behavior of --verify I am interested in is not to check that the ref exists, but to get its SHA1 while avoiding the pattern search. This avoids accidentally matching refs via substring (e.g. "git show-ref --head HEAD" will print HEAD, but also e.g. refs/remotes/origin/HEAD), and for performance reasons (looking up a ref by exact name can be MUCH faster than matching all refs by pattern search, e.g. in one of my projects where I use git as an object store, --verify makes a difference of 21 milliseconds vs. over 5 minutes).

--
Best regards,
 Vladimir

Reply via email to