Skip to content

Commit

Permalink
Prune branhes that are deleted upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed Aug 25, 2024
1 parent 1aaa4dd commit c814370
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ansible/roles/git-mirrors/templates/update-mirrors.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
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)

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
Expand Down

0 comments on commit c814370

Please sign in to comment.