Also this ensures that supplied head is actually present. In the current code in master if new_head is empty or improper then it would still proceed and update **HEAD** to **/refs/heads/#{new_head}**