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

[PATCH] match_push_refs(): nobody sets src->peer_ref anymore

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 4, 2013, 22:36 UTC
Message-ID
<7vlia2x05q.fsf@alter.siamese.dyndns.org>

In ancient times, we used to disallow the same source ref to be pushed to more than one places, e.g. "git push there master:master master:naster" was disallowed. We later lifted this restriction with db27ee63929f (send-pack: allow the same source to be pushed more than once., 2005-08-06) and there no longer is anybody that sets peer_ref for the source side of the ref list in the push codepath since then.

Remove one leftover no-op in a loop that iterates over the source side of ref list (i.e. our local ref) to see if it can/should be sent to a matching destination ref while skipping ones that is marked with peer_ref (which will never exist, so we do not skip anything).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 remote.c | 3 ---
 1 file changed, 3 deletions(-)
diff --git a/remote.c b/remote.c
index e53a6eb..bac2b02 100644
--- a/remote.c
+++ b/remote.c
@@ -1227,9 +1227,6 @@ int match_push_refs(struct ref *src, struct ref **dst,
 		const struct refspec *pat = NULL;
 		char *dst_name;
 
-		if (ref->peer_ref)
-			continue;
-
 		dst_name = get_ref_match(rs, nr_refspec, ref, send_mirror, FROM_SRC, &pat);
 		if (!dst_name)
 			continue;
-- 
1.8.2-rc2-182-g857a7fa
Next: Jeff King
Message 1 of 2 in “match_push_refs(): nobody sets src->peer_ref anymore”
  1. match_push_refs(): nobody sets src->peer_ref anymoreJunio C Hamano, Mar 4, 2013
  2. Jeff KingMar 5, 2013

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.