summaryrefslogtreecommitdiff
path: root/git-ls-remote.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-05-25 04:36:14 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-05-25 04:36:14 (GMT)
commite686eba41f1d19a5731dd12cabe259fd3c17eed6 (patch)
tree23499f6dbdc1f2ae38c7a503d1e3900323674f35 /git-ls-remote.sh
parent84c667ff97da2a3864ef7952b9f438d133ce35ef (diff)
downloadgit-e686eba41f1d19a5731dd12cabe259fd3c17eed6.zip
git-e686eba41f1d19a5731dd12cabe259fd3c17eed6.tar.gz
git-e686eba41f1d19a5731dd12cabe259fd3c17eed6.tar.bz2
ls-remote: fix rsync:// to report HEAD
This prevented recent git-clone from checking out the working tree files in the cloned repository. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-ls-remote.sh')
-rwxr-xr-xgit-ls-remote.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/git-ls-remote.sh b/git-ls-remote.sh
index b6882a9..2fdcaf7 100755
--- a/git-ls-remote.sh
+++ b/git-ls-remote.sh
@@ -58,11 +58,19 @@ http://* | https://* )
;;
rsync://* )
- mkdir $tmpdir
+ mkdir $tmpdir &&
+ rsync -rlq "$peek_repo/HEAD" $tmpdir &&
rsync -rq "$peek_repo/refs" $tmpdir || {
echo "failed slurping"
exit
}
+ head=$(cat "$tmpdir/HEAD") &&
+ case "$head" in
+ ref:' '*)
+ head=$(expr "z$head" : 'zref: \(.*\)') &&
+ head=$(cat "$tmpdir/$head") || exit
+ esac &&
+ echo "$head HEAD"
(cd $tmpdir && find refs -type f) |
while read path
do