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