diff options
author | Tibor Simko <tibor.simko@cern.ch> | 2011-05-13 03:41:19 +0800 |
---|---|---|
committer | Leonid Volnitsky <leonid@volnitsky.com> | 2011-05-13 04:50:36 +0800 |
commit | a68fd801346f54ee020d777a7552701209816a33 (patch) | |
tree | d2ccdeb8a0ba4a37368e65a70ad997e8f8d94284 /git-prompt.sh | |
parent | parse_git_status: recognise "Changes not staged for commit" (diff) | |
download | git-prompt-a68fd801346f54ee020d777a7552701209816a33.tar.gz git-prompt-a68fd801346f54ee020d777a7552701209816a33.tar.bz2 git-prompt-a68fd801346f54ee020d777a7552701209816a33.zip |
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).
Diffstat (limited to 'git-prompt.sh')
-rwxr-xr-x | git-prompt.sh | 5 |
1 files changed, 5 insertions, 0 deletions
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 |