git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Barkalow <barkalow@iabervon.org>
To: git@vger.kernel.org
Cc: Junio C Hamano <junkio@cox.net>
Subject: [PATCH 5/5] Call send-pack with --remote option
Date: Sat, 28 Apr 2007 13:05:22 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0704281304430.28708@iabervon.org> (raw)

When calling send-pack from git-push, use the --remote option when
appropriate.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
 builtin-push.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/builtin-push.c b/builtin-push.c
index 2e944cd..d4734be 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -158,7 +158,7 @@ static int do_push(const char *repo)
 		refspec = remote->push_refspec;
 	}
 
-	argv = xmalloc((refspec_nr + 10) * sizeof(char *));
+	argv = xmalloc((refspec_nr + 11) * sizeof(char *));
 	argv[0] = "dummy-send-pack";
 	argc = 1;
 	if (all)
@@ -180,8 +180,13 @@ static int do_push(const char *repo)
 		if (!prefixcmp(dest, "http://") ||
 		    !prefixcmp(dest, "https://"))
 			sender = "http-push";
-		else if (thin)
-			argv[dest_argc++] = "--thin";
+		else {
+			char *rem = xmalloc(strlen(remote->name) + 10);
+			sprintf(rem, "--remote=%s", remote->name);
+			argv[dest_argc++] = rem;
+			if (thin)
+				argv[dest_argc++] = "--thin";
+		}
 		argv[0] = sender;
 		argv[dest_argc++] = dest;
 		while (dest_refspec_nr--)
-- 
1.5.1.2.255.g6ead4-dirty

             reply	other threads:[~2007-04-28 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-28 17:05 Daniel Barkalow [this message]
2007-04-29  5:51 ` [PATCH 5/5] Call send-pack with --remote option Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0704281304430.28708@iabervon.org \
    --to=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).