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

[PATCH 5/5] Call send-pack with --remote option

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Apr 28, 2007, 17:05 UTC
Message-ID
<Pine.LNX.4.64.0704281304430.28708@iabervon.org>

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
Next: Junio C Hamano
Message 1 of 2 in “Call send-pack with --remote option”
  1. 5/5 Call send-pack with --remote optionDaniel Barkalow, Apr 28, 2007
  2. Junio C HamanoApr 29, 2007

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.