check if git reference is valid