Bisher wurde nur geprüft, ob Branches überschrieben werden (kein Fast-Forward)
und dabei ungetagged sind. Jetzt gilt: sind alle Remote-Stände bereits remote
getagged (einheitlich oder nicht), werden keine TIMESTAMP-Backup-Tags angelegt.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
echo "$remote_tags" | awk '{print $1}' | grep -qxF "$1"
}
-# Step 1: Check if any branch would be rewritten (not just extended) and has no remote tag
+# Step 1: Check if any remote branch state has no tag in the remote repository
need_timestamp_backup=false
for branch in "${BRANCH_NAMES[@]}"; do
remote_commit=$(git rev-parse "refs/remotes/origin/$branch" 2>/dev/null) || continue
- git rev-parse --verify "$branch" &>/dev/null || continue
- # Skip if remote would only be extended (fast-forward)
- git merge-base --is-ancestor "origin/$branch" "$branch" 2>/dev/null && continue
- # Remote would be rewritten — check if it has any tag in the remote repository
if ! remote_has_tag "$remote_commit"; then
need_timestamp_backup=true
break