Skip to contentSkip to conversation

ls-remote fix for rsync:// transport

PATCH In review Junio C Hamano 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ls-remote fix for rsync:// transport

I think this would fix the "cloning rsync:// clones repository fine but does not check out the working tree" problem.

---

git-ls-remote.sh +9 -1
index b6882a9..6b21879 100755
@@ -58,7 +58,8 @@ http://* | https://* )
 	;;
 
 rsync://* )
-	mkdir $tmpdir
+	mkdir $tmpdir &&
+	rsync -rlq "$peek_repo/HEAD" $tmpdir &&
 	rsync -rq "$peek_repo/refs" $tmpdir || {
 		echo "failed	slurping"
 		exit
@@ -69,6 +70,13 @@ rsync://* )
 		cat "$tmpdir/$path" | tr -d '\012'
 		echo "	$path"
 	done &&
+	head=$(cat "$tmpdir/HEAD") &&
+	case "$head" in
+	ref:' '*)
+		head=$(expr "z$head" : 'zref: \(.*\)') &&
+		head=$(cat "$tmpdir/$head") || exit
+	esac &&
+	echo "$head	HEAD" 
 	rm -fr $tmpdir
 	;;
 
#1 lore raw
Quoted 2 lines · On Wed, 24 May 2006 21:22:17 -0700 Junio C Hamano <[email protected]> wrote:

I think this would fix the "cloning rsync:// clones repository fine but does not check out the working tree" problem.

Nice find, works here.

Sean