From 3c5e0185821ef8d266acba64e805deb2192aff65 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 17 Sep 2013 12:27:57 +1200 Subject: Avoid calling svn info twice --- bash/bashrc.d/prompt.bash | 10 +++++----- 1 file 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 -- cgit v1.2.3