[git] couple of fixes/enhancements

One of the issues I noticed is that the branch doesn't change if the sha is the same. I think a user expects the branch to change even if the sha is the same. I haven't created a bug report but instead created a PR :)

I also made a fix for #70 and I made an enhancement because of #149 (I'm not sure if it covers all cases, but it should be faster now when you enter a sha as version).