Skip to content

git checkout fails if trying to use raw branch name that is all digits #81

@tekumara

Description

@tekumara

Branch names that are all digits:

❯ git checkout -b 713
fatal: '' is not a valid branch name
❯ which git
git () {
        case $1 in
                (commit | blame | log | rebase | merge) scmpuff exec -- "$SCMPUFF_GIT_CMD" "$@" ;;
                (checkout | diff | rm | reset | restore) scmpuff exec --relative -- "$SCMPUFF_GIT_CMD" "$@" ;;
                (add) scmpuff exec -- "$SCMPUFF_GIT_CMD" "$@"
                        scmpuff_status ;;
                (*) "$SCMPUFF_GIT_CMD" "$@" ;;
        esac
}

scmpuff 0.5.0
zsh

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions