]> oss.titaniummirror.com Git - git-utils.git/blobdiff - update-mirror
Fix mirroring of git repositories
[git-utils.git] / update-mirror
index dfb9590e57c1305ff5108a8e67320c8812b429e6..b68e8c10b8e6d65954cb2ca591244f6263876489 100755 (executable)
@@ -57,6 +57,7 @@ case "$url" in
       rm -f "$cfg_reporoot/$projdir/.new_clone"
     fi
     echo "[$proj] fetching new commits from upstream"
+    git --git-dir . svn fetch
     git --git-dir . fetch
     ;;
 
@@ -84,13 +85,14 @@ case "$url" in
 
   *)
     if [ -f "$cfg_reporoot/$projdir/.new_clone" ]; then
-      echo "[$proj] initial git-svn setup"
-      git remote rm origin >/dev/null 2>&1 || :
-      git remote add --mirror origin "$url"
+      echo "[$proj] initial git setup"
+      git --git-dir . --bare init
+      git --git-dir . remote rm origin >/dev/null 2>&1 || :
+      git --git-dir . remote add --mirror origin "$url"
     fi
     echo "[$proj] fetching new commits from upstream"
-    git remote update
-    git remote prune origin
+    git --git-dir . remote update
+    git --git-dir . remote prune origin
     ;;
 esac
 
@@ -98,4 +100,4 @@ esac
 git update-server-info
 trap "" EXIT
 rm .clone_in_progress
-echo "[$proj] clone updated.  See $cfg_gitweburl/$projdir"
+echo "[$proj] clone updated.  See $cfg_gitweburl/?p=mirrors/$projdir;a=summary"