git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI
@ 2009-02-03  6:45 Junio C Hamano
  2009-02-03  6:54 ` Mike Hommey
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2009-02-03  6:45 UTC (permalink / raw)
  To: git; +Cc: Tay Ray Chuan

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI
  2009-02-03  6:45 [PATCH] http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI Junio C Hamano
@ 2009-02-03  6:54 ` Mike Hommey
  2009-02-03 10:40   ` Tay Ray Chuan
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Hommey @ 2009-02-03  6:54 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Tay Ray Chuan

On Mon, Feb 02, 2009 at 10:45:56PM -0800, Junio C Hamano wrote:
> 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").

If I recall correctly, http-push just doesn't work without curl-multi,
so the correct fix would be to just disable http-push when
USE_CURL_MULTI is undefined.

Mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] http-push.c: get_remote_object_url() is only used under  USE_CURL_MULTI
  2009-02-03  6:54 ` Mike Hommey
@ 2009-02-03 10:40   ` Tay Ray Chuan
  0 siblings, 0 replies; 3+ messages in thread
From: Tay Ray Chuan @ 2009-02-03 10:40 UTC (permalink / raw)
  To: Mike Hommey; +Cc: Junio C Hamano, git

On Tue, Feb 3, 2009 at 2:54 PM, Mike Hommey <mh@glandium.org> wrote:
> If I recall correctly, http-push just doesn't work without curl-multi,
> so the correct fix would be to just disable http-push when
> USE_CURL_MULTI is undefined.

Indeed, it dies on line 2253 (18d81a).

2252 #ifndef USE_CURL_MULTI
2253         die("git-push is not available for http/https repository
when not compiled with USE_CURL_MULTI");
2254 #endif

-- 
Cheers,
Ray Chuan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-03 10:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03  6:45 [PATCH] http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI Junio C Hamano
2009-02-03  6:54 ` Mike Hommey
2009-02-03 10:40   ` Tay Ray Chuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).