Skip to content

Commit

Permalink
remote-curl: consistently report repo url for http errors
Browse files Browse the repository at this point in the history
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Apr 7, 2013
1 parent cfa0f40 commit d5ccbe4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions remote-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ static struct discovery* discover_refs(const char *service, int for_push)
die("repository '%s' not found", url);
case HTTP_NOAUTH:
show_http_message(&type, &buffer);
die("Authentication failed");
die("Authentication failed for '%s'", url);
default:
show_http_message(&type, &buffer);
http_error(refs_url, http_ret);
http_error(url, http_ret);
die("HTTP request failed");
}

Expand Down

0 comments on commit d5ccbe4

Please sign in to comment.