[PATCH] git-cvsimport-script: add "import only" option
[git.git] / git-clone-script
index 1969742..5a241fb 100755 (executable)
@@ -14,11 +14,13 @@ get_repo_base() {
        (cd "$1" && (cd .git ; pwd)) 2> /dev/null
 }
 
+quiet=
 use_local=no
 while
        case "$#,$1" in
        0,*) break ;;
         *,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;;
+       *,-q|*,--quiet) quiet=-q ;;
        *,-*) usage ;;
        *) break ;;
        esac
@@ -79,4 +81,16 @@ yes,yes)
        ;;
 esac
 
-cd "$D" && git clone-pack "$repo"
+case "$repo" in
+rsync://*)
+       rsync $quiet -avz --ignore-existing "$repo/objects/" "$D/.git/objects/" &&
+       rsync $quiet -avz --ignore-existing "$repo/refs/" "$D/.git/refs/"
+       ;;
+http://*)
+       echo "Somebody should add http fetch" >&2
+       exit 1
+       ;;
+*)
+       cd "$D" && git-clone-pack $quiet "$repo"
+       ;;
+esac