brew versions does not report the head version correctly when you have checked out an earlier version

```bash
% brew versions groovy
2.1.1    git checkout c61e715 /usr/local/Library/Formula/groovy.rb
2.1.0    git checkout ab37262 /usr/local/Library/Formula/groovy.rb
2.0.5    git checkout 1bcf5af /usr/local/Library/Formula/groovy.rb
2.0.4    git checkout 01af5da /usr/local/Library/Formula/groovy.rb
2.0.2    git checkout 1fe5096 /usr/local/Library/Formula/groovy.rb
2.0.1    git checkout 3860b66 /usr/local/Library/Formula/groovy.rb
2.0.0    git checkout 278a37d /usr/local/Library/Formula/groovy.rb
1.8.6    git checkout b688a91 /usr/local/Library/Formula/groovy.rb
...

# Checkout 2.0.2
% git checkout 1fe5096 /usr/local/Library/Formula/groovy.rb

% brew versions groovy
2.0.2    git checkout c61e715 /usr/local/Library/Formula/groovy.rb
2.1.0    git checkout ab37262 /usr/local/Library/Formula/groovy.rb
2.0.5    git checkout 1bcf5af /usr/local/Library/Formula/groovy.rb
2.0.4    git checkout 01af5da /usr/local/Library/Formula/groovy.rb
2.0.1    git checkout 3860b66 /usr/local/Library/Formula/groovy.rb
2.0.0    git checkout 278a37d /usr/local/Library/Formula/groovy.rb
1.8.6    git checkout b688a91 /usr/local/Library/Formula/groovy.rb
...
```

As you can see the head version reported is 2.0.2 but that is the sha for version 2.1.1.  Furthermore, there is no 2.1.1 in the list