Skip to content

Commit 4df13f6

Browse files
peffgitster
authored andcommitted
http: drop http_error function
This function is a single-liner and is only called from one place. Just inline it, which makes the code more obvious. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent de89f0b commit 4df13f6

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

http-push.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ static int remote_exists(const char *path)
15511551
ret = 0;
15521552
break;
15531553
case HTTP_ERROR:
1554-
http_error(url);
1554+
error("unable to access '%s': %s", url, curl_errorstr);
15551555
default:
15561556
ret = -1;
15571557
}

http.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -941,11 +941,6 @@ static int http_get_file(const char *url, const char *filename, int options)
941941
return ret;
942942
}
943943

944-
void http_error(const char *url)
945-
{
946-
error("unable to access '%s': %s", url, curl_errorstr);
947-
}
948-
949944
int http_fetch_ref(const char *base, struct ref *ref)
950945
{
951946
char *url;

http.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,6 @@ extern char *get_remote_object_url(const char *url, const char *hex,
135135
*/
136136
int http_get_strbuf(const char *url, struct strbuf *content_type, struct strbuf *result, int options);
137137

138-
/*
139-
* Prints an error message using error() containing url and curl_errorstr.
140-
*/
141-
void http_error(const char *url);
142-
143138
extern int http_fetch_ref(const char *base, struct ref *ref);
144139

145140
/* Helpers for fetching packs */

0 commit comments

Comments
 (0)