aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Savoye <rob.savoye@linaro.org>2015-04-20 21:29:15 +0000
committerLinaro Code Review <review@review.linaro.org>2015-04-20 21:29:15 +0000
commitc4356d5a8e648877d75efe2b4f16f5768547a2b3 (patch)
tree9691f4d0b2baa2a8d043604acd534d6760697f1d
parent632e674aa378cd84855157594c1a141aeff9a188 (diff)
parent057a64d54acd14dfe07d8eb7725985df110237e2 (diff)
Merge "Change error message to contemplate possible non-identifier inputs"
-rw-r--r--lib/checkout.sh2
-rwxr-xr-xtestsuite/test.sh34
2 files changed, 35 insertions, 1 deletions
diff --git a/lib/checkout.sh b/lib/checkout.sh
index 091264b0..83fbb957 100644
--- a/lib/checkout.sh
+++ b/lib/checkout.sh
@@ -196,7 +196,7 @@ checkout()
local service=
service="`get_git_service $1`"
if test x"${service}" = x ; then
- error "A proper url is required. Call get_URL first."
+ error "Unable to parse service from '$1'. You have either a bad URL, or an identifier that should be passed to get_URL."
return 1
fi
diff --git a/testsuite/test.sh b/testsuite/test.sh
index a0621778..42f5269d 100755
--- a/testsuite/test.sh
+++ b/testsuite/test.sh
@@ -1352,6 +1352,40 @@ echo "================================================"
# These can be painfully slow so test small repos.
+#confirm that checkout works with raw URLs
+testing="http://abe.git@staging.git.linaro.org/git/toolchain/abe.git"
+in="${testing}"
+if test x"${debug}" = xyes; then
+ out="`cd ${local_snapshots} && checkout ${testing}`"
+else
+ out="`cd ${local_snapshots} && checkout ${testing} 2>/dev/null`"
+fi
+if test $? -eq 0; then
+ pass "${testing}"
+else
+ fail "${testing}"
+fi
+
+#confirm that checkout fails approriately with a range of bad services in raw URLs
+for service in "foomatic://" "http:" "http:/fake.git" "http/" "http//" ""; do
+ in="${service}abe.git@staging.git.linaro.org/git/toolchain/abe.git"
+ testing="checkout: ${in} should fail with 'proper URL required' message."
+ if test x"${debug}" = xyes; then
+ out="`cd ${local_snapshots} && checkout ${in} 2> >(tee /dev/stderr)`"
+ else
+ out="`cd ${local_snapshots} && checkout ${in} 2>&1`"
+ fi
+ if test $? -eq 0; then
+ fail "${testing}"
+ else
+ if echo "${out}" | tail -n1 | grep -q "^ERROR.*: checkout (Unable to parse service from '${in}'\\. You have either a bad URL, or an identifier that should be passed to get_URL\\.)$"; then
+ pass "${testing}"
+ else
+ fail "${testing}"
+ fi
+ fi
+done
+
test_checkout ()
{
local should="$1"