summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--credential.c6
-rwxr-xr-xt/t0300-credentials.sh3
2 files changed, 3 insertions, 6 deletions
diff --git a/credential.c b/credential.c
index 39b7cb0c0b..7d43359591 100644
--- a/credential.c
+++ b/credential.c
@@ -405,8 +405,6 @@ int credential_from_url_gently(struct credential *c, const char *url,
void credential_from_url(struct credential *c, const char *url)
{
- if (credential_from_url_gently(c, url, 0) < 0) {
- warning(_("skipping credential lookup for url: %s"), url);
- credential_clear(c);
- }
+ if (credential_from_url_gently(c, url, 0) < 0)
+ die(_("credential url cannot be parsed: %s"), url);
}
diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh
index 646f8456ff..efed3ea295 100755
--- a/t/t0300-credentials.sh
+++ b/t/t0300-credentials.sh
@@ -406,8 +406,7 @@ test_expect_success 'url parser rejects embedded newlines' '
EOF
cat >expect <<-\EOF &&
warning: url contains a newline in its host component: https://one.example.com?%0ahost=two.example.com/
- warning: skipping credential lookup for url: https://one.example.com?%0ahost=two.example.com/
- fatal: refusing to work with credential missing host field
+ fatal: credential url cannot be parsed: https://one.example.com?%0ahost=two.example.com/
EOF
test_i18ncmp expect stderr
'