Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: [PATCH] ls-remote fix for rsync:// transport
Date: Wed, 24 May 2006 21:22:17 -0700	[thread overview]
Message-ID: <7v7j4a3f9i.fsf@assigned-by-dhcp.cox.net> (raw)

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
 	;;
 

             reply	other threads:[~2006-05-25  4:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-25  4:22 Junio C Hamano [this message]
     [not found] ` <20060525010125.e2d6325d.seanlkml@sympatico.ca>
2006-05-25  5:01   ` [PATCH] ls-remote fix for rsync:// transport Sean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v7j4a3f9i.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox