Skip to content

Commit

Permalink
Avoid redundant declaration of missing_target()
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Mike Hommey authored and Junio C Hamano committed Dec 15, 2007
1 parent 02dc534 commit e8dc37e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 26 deletions.
13 changes: 0 additions & 13 deletions http-walker.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,6 @@ static size_t fwrite_sha1_file(void *ptr, size_t eltsize, size_t nmemb,
return size;
}

static int missing__target(int code, int result)
{
return /* file:// URL -- do we ever use one??? */
(result == CURLE_FILE_COULDNT_READ_FILE) ||
/* http:// and https:// URL */
(code == 404 && result == CURLE_HTTP_RETURNED_ERROR) ||
/* ftp:// URL */
(code == 550 && result == CURLE_FTP_COULDNT_RETR_FILE)
;
}

#define missing_target(a) missing__target((a)->http_code, (a)->curl_result)

static void fetch_alternates(struct walker *walker, const char *base);

static void process_object_response(void *callback_data);
Expand Down
13 changes: 13 additions & 0 deletions http.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,17 @@ extern int active_requests;

extern char curl_errorstr[CURL_ERROR_SIZE];

static inline int missing__target(int code, int result)
{
return /* file:// URL -- do we ever use one??? */
(result == CURLE_FILE_COULDNT_READ_FILE) ||
/* http:// and https:// URL */
(code == 404 && result == CURLE_HTTP_RETURNED_ERROR) ||
/* ftp:// URL */
(code == 550 && result == CURLE_FTP_COULDNT_RETR_FILE)
;
}

#define missing_target(a) missing__target((a)->http_code, (a)->curl_result)

#endif /* HTTP_H */
13 changes: 0 additions & 13 deletions transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,19 +426,6 @@ static int curl_transport_push(struct transport *transport, int refspec_nr, cons
return !!err;
}

static int missing__target(int code, int result)
{
return /* file:// URL -- do we ever use one??? */
(result == CURLE_FILE_COULDNT_READ_FILE) ||
/* http:// and https:// URL */
(code == 404 && result == CURLE_HTTP_RETURNED_ERROR) ||
/* ftp:// URL */
(code == 550 && result == CURLE_FTP_COULDNT_RETR_FILE)
;
}

#define missing_target(a) missing__target((a)->http_code, (a)->curl_result)

static struct ref *get_refs_via_curl(struct transport *transport)
{
struct buffer buffer;
Expand Down

0 comments on commit e8dc37e

Please sign in to comment.