aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/prompt.bash7
1 files changed, 7 insertions, 0 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 23c89857..081cff69 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -104,6 +104,13 @@ prompt() {
return 1
fi
+ # Bail if we're not in a work tree
+ local iswt
+ iswt=$(git rev-parse --is-inside-work-tree 2>/dev/null)
+ if [[ $iswt != true ]] ; then
+ return 1
+ fi
+
# Attempt to determine git branch, bail if we can't
local branch
branch=$( {