From 2e783635b47b7b7ed2d04830cd3193f19de8cbbb Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 31 Aug 2016 13:29:18 +1200 Subject: Stop loop when we have needed svn info vars --- bash/bashrc.d/prompt.bash | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bash') diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index 340bca54..5abcf4d8 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -166,7 +166,7 @@ prompt() { svn) # Determine the repository URL and root directory local key value url root - while IFS=: read -r key value ; do + while [[ -z $url || -z $root ]] && IFS=: read -r key value ; do case $key in 'URL') url=${value## } @@ -179,8 +179,7 @@ prompt() { # Exit if we couldn't get either--or, implicitly, if we don't have # svn(1). - [[ -n $url ]] || return - [[ -n $root ]] || return + [[ -n $url && -n $root ]] || return # Remove the root from the URL to get what's hopefully the branch # name, removing leading slashes and the 'branches' prefix, and any -- cgit v1.2.3