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

[PATCH] git-clone: stop dumb protocol from copying refs outside heads/ and tags/.

From
Junio C Hamano <junkio@cox.net>
Date
Nov 25, 2006, 03:17 UTC
Message-ID
<7vac2g8bbi.fsf@assigned-by-dhcp.cox.net>

Most notably, the original code first copied refs/remotes/ that remote side had to local, and overwrote them by mapping refs/heads/ from the remote when a dumb protocol transport was used.

This makes the clone behaviour by dumb protocol in line with the git native and rsync transports.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 * This is another one of those patches I've been doing recently
   after making --use-separate-remote the default.  Judging from
   my experience in the past few days, it is quite surprising
   that none of these were found and reported earlier, given
   that many people made loud noises to make separate-remote the
   default layout.  Maybe they do not eat their own dog food?  I
   honestly do not know...
 git-clone.sh |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh
index 9ed4135..d4ee93f 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -48,6 +48,10 @@ Perhaps git-update-server-info needs to be run there?"
 		case "$name" in
 		*^*)	continue;;
 		esac
+		case "$bare,$name" in
+		yes,* | ,heads/* | ,tags/*) ;;
+		*)	continue ;;
+		esac
 		if test -n "$use_separate_remote" &&
 		   branch_name=`expr "z$name" : 'zheads/\(.*\)'`
 		then
-- 
1.4.4.1.g61fba
Message 1 of 1 in “git-clone: stop dumb protocol from copying refs outside heads/ and tags/.”
  1. git-clone: stop dumb protocol from copying refs outside heads/ and tags/.Junio C Hamano, Nov 25, 2006

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.