|
16 | 16 | #include "send-pack.h"
|
17 | 17 | #include "protocol.h"
|
18 | 18 | #include "quote.h"
|
| 19 | +#include "transport.h" |
19 | 20 |
|
20 | 21 | static struct remote *remote;
|
21 | 22 | /* always ends with a trailing slash */
|
@@ -250,7 +251,7 @@ static struct ref *parse_info_refs(struct discovery *heads)
|
250 | 251 | if (data[i] == '\n') {
|
251 | 252 | if (mid - start != 40)
|
252 | 253 | die("%sinfo/refs not valid: is this a git repository?",
|
253 |
| - url.buf); |
| 254 | + transport_anonymize_url(url.buf)); |
254 | 255 | data[i] = 0;
|
255 | 256 | ref_name = mid + 1;
|
256 | 257 | ref = alloc_ref(ref_name);
|
@@ -388,17 +389,23 @@ static struct discovery *discover_refs(const char *service, int for_push)
|
388 | 389 | break;
|
389 | 390 | case HTTP_MISSING_TARGET:
|
390 | 391 | show_http_message(&type, &charset, &buffer);
|
391 |
| - die("repository '%s' not found", url.buf); |
| 392 | + die("repository '%s' not found", |
| 393 | + transport_anonymize_url(url.buf)); |
392 | 394 | case HTTP_NOAUTH:
|
393 | 395 | show_http_message(&type, &charset, &buffer);
|
394 |
| - die("Authentication failed for '%s'", url.buf); |
| 396 | + die("Authentication failed for '%s'", |
| 397 | + transport_anonymize_url(url.buf)); |
395 | 398 | default:
|
396 | 399 | show_http_message(&type, &charset, &buffer);
|
397 |
| - die("unable to access '%s': %s", url.buf, curl_errorstr); |
| 400 | + die("unable to access '%s': %s", |
| 401 | + transport_anonymize_url(url.buf), curl_errorstr); |
398 | 402 | }
|
399 | 403 |
|
400 |
| - if (options.verbosity && !starts_with(refs_url.buf, url.buf)) |
401 |
| - warning(_("redirecting to %s"), url.buf); |
| 404 | + if (options.verbosity && !starts_with(refs_url.buf, url.buf)) { |
| 405 | + char *u = transport_anonymize_url(url.buf); |
| 406 | + warning(_("redirecting to %s"), u); |
| 407 | + free(u); |
| 408 | + } |
402 | 409 |
|
403 | 410 | last= xcalloc(1, sizeof(*last_discovery));
|
404 | 411 | last->service = xstrdup(service);
|
|
0 commit comments