git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 3, 2009, 06:45 UTC
Message-ID
<7v8woodnmj.fsf@gitster.siamese.dyndns.org>
Otherwise -Wunused-function (which is implied by -Wall) triggers.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

I think this patch is probably a bit on the wrong side of the borderline, in that it *happens to be* that get_remote_object_url() is used by nobody in non-multi codepath right now, but it is entirely possible that future code clean-up can benefit from its use. But without this patch,, the file does not compile for me (I compile everything with "-Werror -Wall").

 http-push.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/http-push.c b/http-push.c
index ba5cc32..203c075 100644
--- a/http-push.c
+++ b/http-push.c
@@ -218,13 +218,6 @@ static void append_remote_object_url(struct strbuf *buf, const char *url,
 		strbuf_addf(buf, "%s", hex+2);
 }
 
-static char *get_remote_object_url(const char *url, const char *hex, int only_two_digit_prefix)
-{
-	struct strbuf buf = STRBUF_INIT;
-	append_remote_object_url(&buf, url, hex, only_two_digit_prefix);
-	return strbuf_detach(&buf, NULL);
-}
-
 static void finish_request(struct transfer_request *request);
 static void release_request(struct transfer_request *request);
 
@@ -237,6 +230,14 @@ static void process_response(void *callback_data)
 }
 
 #ifdef USE_CURL_MULTI
+
+static char *get_remote_object_url(const char *url, const char *hex, int only_two_digit_prefix)
+{
+	struct strbuf buf = STRBUF_INIT;
+	append_remote_object_url(&buf, url, hex, only_two_digit_prefix);
+	return strbuf_detach(&buf, NULL);
+}
+
 static size_t fwrite_sha1_file(void *ptr, size_t eltsize, size_t nmemb,
 			       void *data)
 {
-- 
1.6.1.2.343.g53117
Next: Mike Hommey
Message 1 of 3 in “http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI”
  1. http-push.c: get_remote_object_url() is only used under USE_CURL_MULTIJunio C Hamano, Feb 3, 2009
  2. Mike HommeyFeb 3, 2009
  3. Tay Ray ChuanFeb 3, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.