Remove stale references

This commit is contained in:
Ludwig Nussel 2023-03-08 18:44:03 +01:00
parent ead7d482ac
commit 124bc8584e
2 changed files with 21 additions and 0 deletions

13
pusher
View File

@ -168,6 +168,19 @@ for m in "${!pq[@]}"; do
fi
done
for m in "${!rq[@]}"; do
[ "${#modules[@]}" -eq 0 -o -n "${modules[$m]}" ] || continue
if [ -z "${pq[$m]}" ]; then
log_info "delete remote request $m"
if ! git send-pack --force "$push_url" ":refs/heads/update_$m"; then
echo "failed to push $m update" >&2
ret=1
continue
fi
did_push=1
fi
done
if [ -n "$did_push" ]; then
log_info "Updating remote $PUSH_REMOTE"
git remote update -p "$PUSH_REMOTE" > /dev/null

View File

@ -161,6 +161,14 @@ fi
declare -A pq
makedict pq git for-each-ref 'refs/pq/*' --format '%(refname)'
for r in "${!pq[@]}"; do
m="${r##*/}"
if [ -z "${revs[$m]}" ] && ! isnew "$m" && ! todrop "$m"; then
log_info "remove stale update entry for $m"
git update-ref -d "$r"
fi
done
# check remotes for updates
declare -A commits
treetext=$(git cat-file -p "$REMOTE/$BASE_BRANCH^{tree}")