get branch of commit on detached head