summaryrefslogtreecommitdiffstats
path: root/test-branches.sh
diff options
context:
space:
mode:
authorMichael Allen <michael@michaelallen.io>2015-03-09 11:48:49 +0000
committerMichael Allen <michael@michaelallen.io>2015-03-09 11:48:49 +0000
commit82f5bd7c9c9118f2e5b623860beee1c76e03cec0 (patch)
tree21b077bac2eef1dbd16985412c0fc73c45531b6f /test-branches.sh
parentd95454d16ff21e860669287f194111367e3da9d2 (diff)
downloadgit-sonar-82f5bd7c9c9118f2e5b623860beee1c76e03cec0.tar.gz
git-sonar-82f5bd7c9c9118f2e5b623860beee1c76e03cec0.zip
prevent bad grep usage when no branch_name
Diffstat (limited to '')
-rwxr-xr-xtest-branches.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/test-branches.sh b/test-branches.sh
index 40c5a50..4e52242 100755
--- a/test-branches.sh
+++ b/test-branches.sh
@@ -83,16 +83,16 @@ test_remote_branch_name_quiet_when_not_in_repo() {
debug_output="$(
{
- set -x
output="$(
remote_branch_name;
)"
- set +x
} 2>&1
echo "$output"
)"
- usages="$(echo "$debug_output" | grep 'fatal: ' | wc -l)"
+ usages="$(echo "$debug_output" | grep -E "(usage|fatal):" | wc -l)"
+
+ echo "$debug_output"
assertEquals " 0" "$usages"