Make distinction between hash and branch/tag to make checkouts work properly in all cases