Find all git-refs with desired suffix; choose shortest one

This pull request proposes a fix for https://github.com/opscode/chef/issues/2065

Currently, the output of ```git ls-remote``` is parsed for lines ending with the specified revision. If multiple tags happen to match, the first is returned, which may not represent the desired content.

This change finds all matches, and then returns the match of the shortest length. If the shortest length match does not represent the desired content, then the revision value can be lengthened to uniquely identify the desired content.
Your first test ensures that `v1.0` matches `refs/tags/v1.0`, and your second test ensures that `v1.0` matches `refs/tags/v1.0`.

But you do not have a test showing that `v1.0` matches `refs/heads/v1.0` in the absence of a v1.0 tag.  I'm asking for a test that shows that.