aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-09-21 18:15:50 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-09-21 18:15:50 +1200
commit9eddc4c186916965b138998bd503b28b5cb164fb (patch)
treee3680af6b2c2b645bab73353e20a5e0b1d239b51 /bash
parentsvn has no concept of staging, remove '+' usage (diff)
downloaddotfiles-9eddc4c186916965b138998bd503b28b5cb164fb.tar.gz
dotfiles-9eddc4c186916965b138998bd503b28b5cb164fb.zip
Some more opts/refinements for git prompt
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/prompt.bash11
1 files changed, 3 insertions, 8 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 61d2a39a..cc750934 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -49,19 +49,14 @@ prompt() {
return 1
fi
- # Bail if the required git status call fails
- if ! git status -z --porcelain >/dev/null 2>&1; then
- return 1
- fi
-
- # Attempt to determine git branch
+ # Attempt to determine git branch, bail if we can't
local branch
branch=$(git symbolic-ref --quiet HEAD 2>/dev/null) \
|| branch=$(git rev-parse --short HEAD 2>/dev/null) \
- || branch=unknown
+ || return 1
branch=${branch##*/}
- # Safely read status from ``git porcelain''
+ # Safely read status with -z --porcelain
local line ready modified untracked
while IFS= read -d $'\0' -r line _; do
if [[ $line == [MADRC]* ]]; then