X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=infra%2Fdgit-mirror-rsync;h=2d912c8ad1dd30f335c2f52d8e4f6011a718a22c;hp=0d29ffb3e65621b3fec1f468bd0d64c5d90f3772;hb=b38d6d36f43ef8ac41a937cacbdb7e3ae5535a5a;hpb=b7f362f25ab0d961df1e100af7d07165b5ecdfc3 diff --git a/infra/dgit-mirror-rsync b/infra/dgit-mirror-rsync index 0d29ffb3..2d912c8a 100755 --- a/infra/dgit-mirror-rsync +++ b/infra/dgit-mirror-rsync @@ -54,6 +54,7 @@ rsync=(rsync -rltH --safe-links --delete) hooktimeout=30 rsynctimeout=900 rsyncssh='ssh -o batchmode=yes' +mirror_gc_cmd='git gc --auto' . $distrodir/mirror-settings @@ -74,6 +75,12 @@ case "$remoterepos" in esac actually () { + if [ "x$mirror_gc_cmd" != x ]; then + ( + cd "$repos/$package.git" + $mirror_gc_cmd + ) + fi "${rsync[@]}" \ --timeout=$rsynctimeout \ -e "$rsyncssh" \ @@ -91,7 +98,7 @@ reinvoke () { check-package-mirrorable () { local repo=$repos/$package.git - local mode=$(stat -c%a "$repo") + local mode; mode=$(stat -c%a "$repo") case $mode in *5) return 0 ;; *0) return 1 ;;