diff --git a/Scripts/Bash/Functions/cli_getRepoStatus.sh b/Scripts/Bash/Functions/cli_getRepoStatus.sh index e5e80c9..a7b42db 100755 --- a/Scripts/Bash/Functions/cli_getRepoStatus.sh +++ b/Scripts/Bash/Functions/cli_getRepoStatus.sh @@ -35,7 +35,7 @@ function cli_getRepoStatus { # Define regular expression pattern to retrive first column, # returned by subversion status command. This column is one # character column as describes `svn help status' command. - local PATTERN="^( |A|C|D|I|M|R|X|\?|!|~).+$" + local PATTERN='^( |A|C|D|I|M|R|X|\?|!|~).+$' # Verify the file used as source to retrive its status # information. We only use regular files or directories inside the @@ -44,22 +44,8 @@ function cli_getRepoStatus { cli_checkFiles "$LOCATION" 'isInWorkingCopy' # Use subversion `status' command to retrive the first character - # in the output. - STATUS="$(svn status "$LOCATION" --quiet | sed -r "s/${PATTER}/\1/")" - - # Sanitate status output. - if [[ "$STATUS" == '' ]];then - # If status is empty, there is no output error and we assume - # file being checked doesn't have changes either, so redefine - # status as `no modification'. - STATUS=' ' - elif [[ ! "$STATUS" =~ "$PATTERN" ]];then - # If status doesn't match the regular expression pattern - # defined previusly, we assume file being checked is not under - # version control, so we redefine status as `item is not under - # version control'. - STATUS='?' - fi + # in the output. Discard standard error output. + STATUS="$(svn status "$LOCATION" | sed -r "s/${PATTERN}/\1/" 2>/dev/null)" # Outout status information. echo -n "$STATUS"