for-each-ref: Do not lookup objects when they will not be used
This makes commands such as `git for-each-ref --format='%(refname)'`, which are used heavily by the bash_completion code, run about 6 times faster on an uncached repository (3 s intead of 18 s on my linux-2.6 repository with several remotes). Signed-off-by: NAnders Kaseorg <andersk@mit.edu> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
Showing
想要评论请 注册 或 登录