Browse Source

Merge "Fix cherry-pick check for merge patch" into stable/train

changes/64/740064/1
Zuul 1 month ago
committed by Gerrit Code Review
parent
commit
5e36e91bb2
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      tools/check-cherry-picks.sh

+ 11
- 1
tools/check-cherry-picks.sh View File

@@ -4,7 +4,17 @@
# to verify that they're all on either master or stable/ branches
#

hashes=$(git show --format='%b' --quiet $1 | sed -nr 's/^.cherry picked from commit (.*).$/\1/p')
commit_hash=""

# Check if the patch is a merge patch by counting the number of parents.
# If the patch has 2 parents, then the 2nd parent is the patch we want
# to validate.
parent_number=$(git show --format='%P' --quiet | awk '{print NF}')
if [ $parent_number -eq 2 ]; then
commit_hash=$(git show --format='%P' --quiet | awk '{print $NF}')
fi

hashes=$(git show --format='%b' --quiet $commit_hash | sed -nr 's/^.cherry picked from commit (.*).$/\1/p')
checked=0
branches+=""
for hash in $hashes; do


Loading…
Cancel
Save