Skip to contentSkip to conversation

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

PATCH New Junio C Hamano 1 participant 1 message Aug 11, 2016

lore
Share & tools
lore
#0 lore raw

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

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.

---

* 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(-)
git-clone.sh +4 -0
index 9ed4135..d4ee93f 100755
@@ -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
Signature · 1 line
1.4.4.1.g61fba