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

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

From
Junio C Hamano <junkio@cox.net>
Date
May 25, 2006, 04:22 UTC
Message-ID
<7v7j4a3f9i.fsf@assigned-by-dhcp.cox.net>

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

---
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
 	;;
 
Next: Sean
Message 1 of 2 in “ls-remote fix for rsync:// transport”
  1. ls-remote fix for rsync:// transportJunio C Hamano, May 25, 2006
  2. SeanMay 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.