mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
ci/check-cherry-picks: support different remotes than "origin"
The default is to checkout a contributors fork as "origin", thus the NixOS/nixpkgs remote is most likely named differently. But not everybody keeps their fork's main branches up-to-date all the time. Thus the script would fail locally.
This commit is contained in:
parent
6cf5f9e83b
commit
2fea2bbf52
1 changed files with 5 additions and 2 deletions
|
@ -14,6 +14,9 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
|
|||
PICKABLE_BRANCHES=${PICKABLE_BRANCHES:-master staging release-??.?? staging-??.??}
|
||||
problem=0
|
||||
|
||||
# Not everyone calls their remote "origin"
|
||||
remote="$(git remote -v | grep -i 'NixOS/nixpkgs' | head -n1 | cut -f1 || true)"
|
||||
|
||||
commits="$(git rev-list -E -i --grep="cherry.*[0-9a-f]{40}" --reverse "$1..$2")"
|
||||
|
||||
while read -r new_commit_sha ; do
|
||||
|
@ -40,10 +43,10 @@ while read -r new_commit_sha ; do
|
|||
fi
|
||||
|
||||
set -f # prevent pathname expansion of patterns
|
||||
for branch_pattern in $PICKABLE_BRANCHES ; do
|
||||
for pattern in $PICKABLE_BRANCHES ; do
|
||||
set +f # re-enable pathname expansion
|
||||
|
||||
branches="$(git for-each-ref --format="%(refname)" "refs/remotes/origin/$branch_pattern")"
|
||||
branches="$(git for-each-ref --format="%(refname)" "refs/remotes/${remote:-origin}/$pattern")"
|
||||
|
||||
while read -r picked_branch ; do
|
||||
if git merge-base --is-ancestor "$original_commit_sha" "$picked_branch" ; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue