diff options
Diffstat (limited to 'bash/bashrc.d/prompt.bash')
-rw-r--r-- | bash/bashrc.d/prompt.bash | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index 0009fe94..6ecf44ba 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -72,24 +72,24 @@ prompt() { # If there are staged changes in the working tree, add a plus sign # to the state if ! git diff --quiet --ignore-submodules --cached; then - state[${#state[@]}]='+' + state=("${state[@]}" '+') fi # If there are any modified tracked files in the working tree, add # an exclamation mark to the state if ! git diff-files --quiet --ignore-submodules --; then - state[${#state[@]}]='!' + state=("${state[@]}" '!') fi # If there are any stashed changes, add a circumflex to the state if git rev-parse --verify refs/stash >/dev/null 2>&1; then - state[${#state[@]}]='^' + state=("${state[@]}" '^') fi # If there are any new unignored files in the working tree, add a # question mark to the state if [[ $(git ls-files --others --exclude-standard) ]]; then - state[${#state[@]}]='?' + state=("${state[@]}" '?') fi # Print the status in brackets with a git: prefix @@ -111,7 +111,7 @@ prompt() { # If there are changes in the tree, add an exclamation mark to the # state if [[ $(hg status 2>/dev/null) ]]; then - state[${#state[@]}]='!' + state=("${state[@]}" '!') fi # Print the status in brackets with an hg: prefix @@ -146,7 +146,7 @@ prompt() { # If there are changes in the working directory, add an exclamation # mark to the state if [[ $(svn status 2>/dev/null) ]]; then - state[${#state[@]}]='!' + state=("${state[@]}" '!') fi # Print the state in brackets with an svn: prefix |