The current checkout code does not work well with tags. If revision points to a tag that is not pointing to the latest commit, the old logic does the following:
Try to checkout by interpreting revision as a hash (which is not)
Then find the commit pointed by the tag
Move HEAD to that
This moves the HEAD to the correct commit but leaves the work directory checked out the "invalid" hash which becomes the master head state.
And this inconsistent state can cause even more weird behavior if the cache is not cleaned.
The new logic first determines if revision is a tag or not, and based on that does a proper checkout.
The current checkout code does not work well with tags. If
revision
points to a tag that is not pointing to the latest commit, the old logic does the following:revision
as a hash (which is not)HEAD
to thatThis moves the HEAD to the correct commit but leaves the work directory checked out the "invalid" hash which becomes the master head state. And this inconsistent state can cause even more weird behavior if the cache is not cleaned.
The new logic first determines if
revision
is a tag or not, and based on that does a proper checkout.