mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
maintainer/scripts/check-cherry-picks: propagate git errors instead of passing silently
Bash will not propagate the exit code from a subshell within a
herestring, so the script silently passes when git throws an error
there. Re-arranging things a bit and an error will now be thrown.
(cherry picked from commit d283c3b36f)
This commit is contained in:
committed by
github-actions[bot]
parent
0559265170
commit
bc993cda69
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# Find alleged cherry-picks
|
||||
|
||||
set -e
|
||||
set -eo pipefail
|
||||
|
||||
if [ $# != "2" ] ; then
|
||||
echo "usage: check-cherry-picks.sh base_rev head_rev"
|
||||
@@ -11,6 +11,10 @@ fi
|
||||
PICKABLE_BRANCHES=${PICKABLE_BRANCHES:-master staging release-??.?? staging-??.??}
|
||||
problem=0
|
||||
|
||||
commits="$(git rev-list \
|
||||
-E -i --grep="cherry.*[0-9a-f]{40}" --reverse \
|
||||
"$1..$2")"
|
||||
|
||||
while read new_commit_sha ; do
|
||||
if [ -z "$new_commit_sha" ] ; then
|
||||
continue # skip empty lines
|
||||
@@ -88,10 +92,6 @@ while read new_commit_sha ; do
|
||||
echo "$original_commit_sha not found in any pickable branch"
|
||||
|
||||
problem=1
|
||||
done <<< "$(
|
||||
git rev-list \
|
||||
-E -i --grep="cherry.*[0-9a-f]{40}" --reverse \
|
||||
"$1..$2"
|
||||
)"
|
||||
done <<< "$commits"
|
||||
|
||||
exit $problem
|
||||
|
||||
Reference in New Issue
Block a user