dag: prefer the clicked commit when checking out branches