X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/7999d98d57d93ee5ee0eae680cc082b6733595ce..acddd005faa6ddeace298b1a5cade4f6ae27f281:/zsh/lib/prompt.zsh diff --git a/zsh/lib/prompt.zsh b/zsh/lib/prompt.zsh index 61f5db8..3fc1c24 100644 --- a/zsh/lib/prompt.zsh +++ b/zsh/lib/prompt.zsh @@ -41,9 +41,9 @@ git_prompt_status() { # Get current status. while IFS=$'\n' read line; do if [[ "$line" == \#\#\ * ]]; then - [[ "$line" =~ '## ([^.]*)\.\.\.(.*)' ]] && branch=$match[1] - [[ "$line" =~ 'ahead ([0-9]+)' ]] && ahead=$match[1] - [[ "$line" =~ 'behind ([0-9]+)' ]] && behind=$match[1] + [[ "$line" =~ '## (.*?)(\.\.\.|$)' ]] && branch=$match[1] + [[ "$line" =~ 'ahead ([0-9]+)' ]] && ahead=$match[1] + [[ "$line" =~ 'behind ([0-9]+)' ]] && behind=$match[1] else # Count added, deleted, modified, renamed, unmerged, untracked, dirty. # T (type change) is undocumented, see http://git.io/FnpMGw.