verify_refname_available(): new function
verify_refname_available(): new function

Add a new verify_refname_available() function, which checks whether the
refname is available for use, taking all references (both packed and
loose) into account. This function, unlike the old
verify_refname_available(), has semantics independent of the choice of
reference storage, and can therefore be implemented by alternative
reference backends.

Use the new function in a couple of places.

Signed-off-by: Ronnie Sahlberg <2cb6c6c4ccf58d41468189c2307f7a4ebf120324@google.com>
Signed-off-by: David Turner <a13b1135e6f2f8530e85bc2896cd5ed89a6ed863@twopensource.com>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>
Signed-off-by: Michael Haggerty <c24c152f145c57791e809b126db9e61bd1c1782d@alum.mit.edu>
Signed-off-by: Jeff King <696e3fbcf235d40b6ea1ebd61c87cbea79d444e7@peff.net>

destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git