Teach "git clone" about rsync sources
[gitweb.git] / git-clone-script
index 19697427ecfac400809eee9ba7c1625eea13f409..01707e92aac0c2ed654d14df230e19ab9378fa94 100755 (executable)
@@ -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