Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

ci/check-cherry-picks: never check older stable branches

This makes the job significantly faster when the commit can't be found
on master or staging directly. Before this change, the script would have
had to iterate through 20+ release branches before finding the latest
one. With lazy fetching for git enabled, this would take a few minutes.

(cherry picked from commit a9b718b79640e9c0ad4366391654fd4138248187)

authored by Wolfgang Walther and committed by github-actions[bot] bcf8f3fa 5f23ca9c

Changed files
+8 -1
ci
+8 -1
ci/check-cherry-picks.sh
··· 46 46 for pattern in $PICKABLE_BRANCHES ; do 47 47 set +f # re-enable pathname expansion 48 48 49 - branches="$(git for-each-ref --format="%(refname)" "refs/remotes/${remote:-origin}/$pattern")" 49 + # Reverse sorting by refname and taking one match only means we can only backport 50 + # from unstable and the latest stable. That makes sense, because even right after 51 + # branch-off, when we have two supported stable branches, we only ever want to cherry-pick 52 + # **to** the older one, but never **from** it. 53 + # This makes the job significantly faster in the case when commits can't be found, 54 + # because it doesn't need to iterate through 20+ branches, which all need to be fetched. 55 + branches="$(git for-each-ref --sort=-refname --format="%(refname)" \ 56 + "refs/remotes/${remote:-origin}/$pattern" | head -n1)" 50 57 51 58 while read -r picked_branch ; do 52 59 if git merge-base --is-ancestor "$original_commit_sha" "$picked_branch" ; then