I think the weird output has to do with some of the settings we already have in our .zshrc. I got a different kind of weird output:

    $ set -x
    +-zsh:2> parse_git_branch
    +parse_git_branch:1> ref=+parse_git_branch:1> ref=''
    +parse_git_branch:2> [[ -n '' ]]
    +-zsh:2> parse_git_uncommitted
    +parse_git_uncommitted:1> [[ -d .git ]]
    +-zsh:2> parse_git_unstaged
    +parse_git_unstaged:1> line=+parse_git_unstaged:1> line=+parse_git_unstaged:1> sed -n '2 p'
    +parse_git_unstaged:1> line=''
    +parse_git_unstaged:2> [[ -d .git ]]