Skip to content

Commit d5ccbe4

Browse files
peffgitster
authored andcommitted
remote-curl: consistently report repo url for http errors
When we report http errors in fetching the initial ref advertisement, we show the full URL we attempted to use, including "info/refs?service=git-upload-pack". While this may be useful for debugging a broken server, it is unnecessarily verbose and confusing for most cases, in which the client user is not even the same person as the owner of the repository. Let's just show the repository URL; debugging can happen with GIT_CURL_VERBOSE, which shows way more useful information, anyway. At the same time, let's also make sure to mention the repository URL when we report failed authentication (previously we said only "Authentication failed"). Knowing the URL can help the user realize why authentication failed (e.g., they meant to push to remote A, not remote B). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cfa0f40 commit d5ccbe4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

remote-curl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ static struct discovery* discover_refs(const char *service, int for_push)
213213
die("repository '%s' not found", url);
214214
case HTTP_NOAUTH:
215215
show_http_message(&type, &buffer);
216-
die("Authentication failed");
216+
die("Authentication failed for '%s'", url);
217217
default:
218218
show_http_message(&type, &buffer);
219-
http_error(refs_url, http_ret);
219+
http_error(url, http_ret);
220220
die("HTTP request failed");
221221
}
222222

0 commit comments

Comments
 (0)