summaryrefslogtreecommitdiff
path: root/git-clone-script
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-09 00:07:12 (GMT)
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-09 00:07:12 (GMT)
commit7558ef89edce07555c6436cfcb98c31388dd99b0 (patch)
tree729fc68a9d4f8d7c0db8d1e36dcc749e458ea7fc /git-clone-script
parent113b94751d7f10617e22de0d017033a52b224c68 (diff)
downloadgit-7558ef89edce07555c6436cfcb98c31388dd99b0.zip
git-7558ef89edce07555c6436cfcb98c31388dd99b0.tar.gz
git-7558ef89edce07555c6436cfcb98c31388dd99b0.tar.bz2
Teach "git clone" about rsync sources
That will be the normal way of cloning anonymously for a while, so let's make sure it's easy to use.
Diffstat (limited to 'git-clone-script')
-rwxr-xr-xgit-clone-script14
1 files changed, 13 insertions, 1 deletions
diff --git a/git-clone-script b/git-clone-script
index 1969742..01707e9 100755
--- a/git-clone-script
+++ b/git-clone-script
@@ -79,4 +79,16 @@ yes,yes)
;;
esac
-cd "$D" && git clone-pack "$repo"
+case "$repo" in
+rsync://*)
+ rsync -avz --ignore-existing "$repo/objects/" "$D/.git/objects/" &&
+ rsync -avz --ignore-existing "$repo/refs/" "$D/.git/refs/"
+ ;;
+http://*)
+ echo "Somebody should add http fetch" >&2
+ exit 1
+ ;;
+*)
+ cd "$D" && git-clone-pack "$repo"
+ ;;
+esac