From 73354ae5b239d6d23569d73f077691e1f3b75496 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 31 May 2026 19:53:23 +0000 Subject: [PATCH] =?utf8?q?lib.sh:=20reset=5Fbranches=5Fto=5Fremote=20zeigt?= =?utf8?q?=20nur=20tats=C3=A4chlich=20ge=C3=A4nderte=20Branches?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Branches, bei denen lokaler Stand und origin/ bereits identisch sind, werden ohne Ausgabe übersprungen. Profitiert auch reset.sh. Co-Authored-By: Claude Sonnet 4.6 --- lib.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib.sh b/lib.sh index c540626c..31bd8472 100755 --- a/lib.sh +++ b/lib.sh @@ -37,8 +37,11 @@ find_common_tag_suffixes() { # Erwartet, dass origin aktuell ist — ggf. vorher git fetch origin aufrufen. # Kehrt am Ende zu scripting zurück. reset_branches_to_remote() { - local branch + local branch local_hash remote_hash for branch in "${BRANCH_NAMES[@]}"; do + local_hash=$(git rev-parse "$branch" 2>/dev/null) || continue + remote_hash=$(git rev-parse "refs/remotes/origin/$branch" 2>/dev/null) || continue + [ "$local_hash" != "$remote_hash" ] || continue echo " $branch" git checkout -q "$branch" git reset -q --hard "origin/$branch" -- 2.39.5