From: Brodie Rao Date: Tue, 7 Jan 2014 03:32:01 +0000 (-0800) Subject: sha1_name: don't resolve refs when core.warnambiguousrefs is false X-Git-Tag: v1.9-rc0~16^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/832cf74c0792a58c9c28e32a8fe5dbb694f0cce6?hp=832cf74c0792a58c9c28e32a8fe5dbb694f0cce6 sha1_name: don't resolve refs when core.warnambiguousrefs is false When seeing a full 40-hex object name, get_sha1_basic() unconditionally checks if the string can also be interpreted as a refname, but the result will not be used unless warn_ambiguous_refs is in effect. Omitting this unnecessary ref resolution provides a substantial performance improvement, especially when passing many hashes to a command (like "git rev-list --stdin") and core.warnambiguousrefs is set to false. The check incurs 6 stat()s for every hash supplied, which can be costly over NFS. Signed-off-by: Brodie Rao Acked-by: Nguyễn Thái Ngọc Duy Acked-by: Jeff King Signed-off-by: Junio C Hamano ---