From a68fd801346f54ee020d777a7552701209816a33 Mon Sep 17 00:00:00 2001 From: Tibor Simko Date: Fri, 13 May 2011 03:41:19 +0800 Subject: parse_git_status: recognise "Unmerged paths" Recognise "Unmerged paths" section when parsing git status. This fixes the display of files with merge conflicts in the prompt when using git v1.7 (e.g. Debian Wheezy). --- git-prompt.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'git-prompt.sh') diff --git a/git-prompt.sh b/git-prompt.sh index 559e3c3..9cb4f87 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -450,6 +450,11 @@ parse_git_status() { s/^# unmerged: '"$file_regex"'/ [[ \" ${modified_files[*]} \" =~ \" \1 \" ]] || modified_files[${#modified_files[@]}]=\"\1\"/p } + /^# Unmerged paths:/,/^[^#]/ { + s/^# Unmerged paths:/modified=modified;/p + s/^# both modified:\s*'"$file_regex"'/ [[ \" ${modified_files[*]} \" =~ \" \1 \" ]] || modified_files[${#modified_files[@]}]=\"\1\"/p + } + /^# Untracked files:/,/^[^#]/{ s/^# Untracked files:/untracked=untracked;/p s/^# '"$file_regex"'/ [[ \" ${untracked_files[*]} ${modified_files[*]} ${added_files[*]} \" =~ \" \1 \" ]] || untracked_files[${#untracked_files[@]}]=\"\1\"/p -- cgit v1.2.3