diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-09-17 12:27:57 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-09-17 12:27:57 +1200 |
commit | 3c5e0185821ef8d266acba64e805deb2192aff65 (patch) | |
tree | d2c0116bcb0eab520010b60bcbb1fb740a72ce9d /bash/bashrc.d | |
parent | Rewrite svn info parsing using builtins (diff) | |
download | dotfiles-3c5e0185821ef8d266acba64e805deb2192aff65.tar.gz dotfiles-3c5e0185821ef8d266acba64e805deb2192aff65.zip |
Avoid calling svn info twice
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r-- | bash/bashrc.d/prompt.bash | 10 |
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 |