threads / patch / 4286

patchls-remote fix for rsync:// transport

Subject: [PATCH] ls-remote fix for rsync:// transport

## tl;dr

2 messages between May 25, 2006 and May 25, 2006. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Junio C Hamano· May 25, 2006, 04:22 UTC · lore

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

---
Show changes to git-ls-remote.sh +9 −1
diff --git a/git-ls-remote.sh b/git-ls-remote.sh
index b6882a9..6b21879 100755
--- a/git-ls-remote.sh
+++ b/git-ls-remote.sh
@@ -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
 	;;
 
Sean· May 25, 2006, 05:01 UTC · re: Junio C Hamano · lore

Re: [PATCH] ls-remote fix for rsync:// transport

On Wed, 24 May 2006 21:22:17 -0700 Junio C Hamano <junkio@cox.net> 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

← back to recent threads