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.
It seems like you need a test exactly like this one except it does return the `heads` SHA.

```
    it "converts resource.revision from a tag to a SHA, matching tags first, then heads" do
      @resource.revision "v1.0"
      @stdout = ("d03c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha\n" +
          "663c22a5e41f5ae3193460cca044ed1435029f53\trefs/tags/v0.8-alpha\n" +
          "503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/v1.0\n")
      @provider.should_receive(:shell_out!).with(@git_ls_remote + "\"v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
      @provider.target_revision.should eql("503c22a5e41f5ae3193460cca044ed1435029f53")
    end
```

I know the test above does that, but it does not have a chance to match the `heads` SHA.