summaryrefslogtreecommitdiff
path: root/git-prompt.sh
diff options
context:
space:
mode:
authorTibor Simko <tibor.simko@cern.ch>2011-05-13 03:41:19 +0800
committerLeonid Volnitsky <leonid@volnitsky.com>2011-05-13 04:50:36 +0800
commita68fd801346f54ee020d777a7552701209816a33 (patch)
treed2ccdeb8a0ba4a37368e65a70ad997e8f8d94284 /git-prompt.sh
parentparse_git_status: recognise "Changes not staged for commit" (diff)
downloadgit-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-xgit-prompt.sh5
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