Fix ensure_has_branch invocation