def METHOD_NAME(cmd, args, done, initial_text_=None):
    # type: (GsWindowCommand, Args, Kont, str) -> None
    def done_(branch_name):
        branch_name = branch_name.strip().replace(" ", "-")
        if not branch_name:
            return None
        if not cmd.validate_branch_name(branch_name):
            sublime.error_message(NEW_BRANCH_INVALID.format(branch_name))
            METHOD_NAME(cmd, args, done, initial_text_=branch_name)
            return None
        done(branch_name)
    show_single_line_input_panel(
        call_with_wanted_args(caption, args),
        initial_text_ or call_with_wanted_args(initial_text, args),
        done_
    )