this will lead to reflog's like: "checkout: moving from HEAD". We want to deref headRef to get to the branch name HEAD points to. Something like headRef.getTarget().getName(). Maybe we have to take care that headRef.getTarget() is not null.