aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-24 16:27:09 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-24 16:27:09 +1200
commitce744ec012a6a10ae8dfedc553eacaa6be924668 (patch)
tree7e9481719593f9042e84c7011964fb78b79b5e76 /bash
parentRemove unnecessary command substitution (diff)
downloaddotfiles-ce744ec012a6a10ae8dfedc553eacaa6be924668.tar.gz
dotfiles-ce744ec012a6a10ae8dfedc553eacaa6be924668.zip
Bail if git status fails while building prompt
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/prompt.bash6
1 files changed, 4 insertions, 2 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 9de8471a..83419856 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -51,8 +51,10 @@ prompt() {
fi
# Read the repository's status to refresh its info; ignore all the
- # output
- git status &>/dev/null
+ # output; give up if this fails
+ if ! git status &>/dev/null; then
+ return 1
+ fi
# Figure out the branch to show for HEAD, whether a symbolic
# reference or a short SHA-1; chop off any leading path