aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/prompt.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-09-17 12:27:57 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-09-17 12:27:57 +1200
commit3c5e0185821ef8d266acba64e805deb2192aff65 (patch)
treed2c0116bcb0eab520010b60bcbb1fb740a72ce9d /bash/bashrc.d/prompt.bash
parentRewrite svn info parsing using builtins (diff)
downloaddotfiles-3c5e0185821ef8d266acba64e805deb2192aff65.tar.gz
dotfiles-3c5e0185821ef8d266acba64e805deb2192aff65.zip
Avoid calling svn info twice
Diffstat (limited to 'bash/bashrc.d/prompt.bash')
-rw-r--r--bash/bashrc.d/prompt.bash10
1 files changed, 5 insertions, 5 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 2a21cb1d..1f2e1b8f 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -141,11 +141,6 @@ prompt() {
return 1
fi
- # Exit if not inside a Subversion working copy
- if ! svn info >/dev/null 2>&1; then
- return 1
- fi
-
# Determine the repository URL and root directory
local url root
while IFS=: read key value; do
@@ -159,6 +154,11 @@ prompt() {
esac
done < <(svn info 2>/dev/null)
+ # Exit if we couldn't get either
+ if ! [[ $url && $root ]]; then
+ return 1
+ fi
+
# Remove the root from the URL to get what's hopefully the branch
# name, removing leading slashes and the 'branches' prefix, and any
# trailing content after a slash