aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2024-08-25 21:49:07 +0100
committerGravatar Joe Banks <[email protected]>2024-08-25 23:14:46 +0100
commitc814370164decf3454b1a2b67a3fbaa5ca0cffd7 (patch)
treee808f6ae44ed86bebc94b6b0480ce5ff670352ea
parentAdd cgit customisation values to git-mirrors vars (diff)
Prune branhes that are deleted upstream
-rw-r--r--ansible/roles/git-mirrors/templates/update-mirrors.sh.j24
1 files changed, 2 insertions, 2 deletions
diff --git a/ansible/roles/git-mirrors/templates/update-mirrors.sh.j2 b/ansible/roles/git-mirrors/templates/update-mirrors.sh.j2
index 52831b6..7e3b847 100644
--- a/ansible/roles/git-mirrors/templates/update-mirrors.sh.j2
+++ b/ansible/roles/git-mirrors/templates/update-mirrors.sh.j2
@@ -3,7 +3,7 @@
set -u
# Base location of all mirrors
-MIRRORS_BASE_DIR="/srv/git-mirrors/mirrored"
+MIRRORS_BASE_DIR="{{ git_mirrors_base_dir }}/mirrored"
# Locate repositories knowing that there will be a HEAD file inside them
FOUND_REPOS=$(find "$MIRRORS_BASE_DIR" -name "HEAD" | xargs dirname)
@@ -11,7 +11,7 @@ FOUND_REPOS=$(find "$MIRRORS_BASE_DIR" -name "HEAD" | xargs dirname)
for repo in $FOUND_REPOS; do
cd "$repo";
echo "Updating $repo mirror..."
- if ! git fetch -q; then
+ if ! git fetch -q --prune; then
echo "Error: Failed to update repository $repo"
exit 1
fi