Fix remote sync check in release trigger script
- Replace unreliable git fetch --dry-run check - Use git rev-parse to compare local and remote commits - Prevents false warnings about diverged branches
This commit is contained in:
parent
0739b3ade1
commit
e822ab7ae1
1 changed files with 7 additions and 2 deletions
|
|
@ -61,8 +61,13 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check 4: Up to date with remote
|
# Check 4: Up to date with remote
|
||||||
if ! git fetch origin --dry-run 2>&1 | grep -q "up to date"; then
|
git fetch origin --quiet
|
||||||
echo "⚠️ Warning: Remote has updates or local branch is ahead"
|
LOCAL=$(git rev-parse @)
|
||||||
|
REMOTE=$(git rev-parse @{u})
|
||||||
|
|
||||||
|
if [ "$LOCAL" != "$REMOTE" ]; then
|
||||||
|
echo "⚠️ Warning: Local and remote branches have diverged"
|
||||||
|
git status -sb
|
||||||
echo ""
|
echo ""
|
||||||
read -p "Continue anyway? [y/N] " -n 1 -r
|
read -p "Continue anyway? [y/N] " -n 1 -r
|
||||||
echo ""
|
echo ""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue