Skip to content

Commit

Permalink
-Fix: escape backslahses in VCS names lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Juhász Péter committed Oct 19, 2014
1 parent a242d01 commit fc222fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions git-prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ parse_svn_status() {
### get status

unset status modified added clean init deleted untracked conflicted op detached
eval `svn status 2>/dev/null |
eval `svn status 2>/dev/null | sed 's/\\\\/x/g' |
sed -n '
s/^A... \([^.].*\)/ added_files+=(\"\1\");/p
s/^M... \([^.].*\)/ modified_files+=(\"\1\");/p
Expand Down Expand Up @@ -856,7 +856,7 @@ parse_hg_status() {
### get status
unset status modified added clean init deleted untracked op detached

eval `hg status 2>/dev/null |
eval `hg status 2>/dev/null | sed 's/\\\\/x/g' |
sed -n '
s/^M \([^.].*\)/ modified_files+=(\"\1\");/p
s/^A \([^.].*\)/ added_files+=(\"\1\");/p
Expand Down Expand Up @@ -968,7 +968,7 @@ parse_git_status() {

# info not in porcelain status
eval " $(
LANG=C git status 2>/dev/null |
LANG=C git status 2>/dev/null | sed 's/\\\\/x/g' |
sed -n '
s/^\(# \)*On branch /branch=/p
s/^nothing to commi.*/clean=clean/p
Expand All @@ -991,7 +991,7 @@ parse_git_status() {
# A "with space" <------------- WITH QOUTES

eval " $(
LANG=C git status --porcelain 2>/dev/null |
LANG=C git status --porcelain 2>/dev/null | sed 's/\\\\/x/g' |
sed -n '
s,^U. \([^\"][^/]*/\?\).*, conflicted_files+=(\"\1\"),p
s,^U. \"\([^/]\+/\?\).*\"$, conflicted_files+=(\"\1\"),p
Expand Down

0 comments on commit fc222fb

Please sign in to comment.