mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 07:18:03 +02:00
checkpatch: fix "checkpatch-feature-branch.sh" for master branch
The main purpose of "checkpatch-feature-branch.sh" is to test all
patches of a feature branch. When we run the script against master
(or nm-1-*), then there is no feature branch.
Previously, the script would just error out.
That is not very useful, in particular as we call this from gitlab-ci,
which also runs on master.
Instead, in that case, test the HEAD.
(cherry picked from commit 4543785438)
This commit is contained in:
parent
52542cbf6a
commit
f41a69d416
1 changed files with 5 additions and 1 deletions
|
|
@ -17,7 +17,11 @@ RANGES=( $(git show-ref | sed 's#^\(.*\) '"$BASE_REF"'\(master\|nm-1-[0-9]\+\)$#
|
||||||
|
|
||||||
REFS=( $(git log --reverse --format='%H' "${RANGES[@]}") )
|
REFS=( $(git log --reverse --format='%H' "${RANGES[@]}") )
|
||||||
|
|
||||||
[ "${#REFS[@]}" != 0 ] || die "no refs detected (HEAD is $(git rev-parse HEAD))"
|
if [ "${#REFS[@]}" == 0 ] ; then
|
||||||
|
# no refs detected. This means, $HEAD is already on master (or one of the
|
||||||
|
# stable nm-1-* branches. Just check the patch itself.
|
||||||
|
REFS=( $HEAD )
|
||||||
|
fi
|
||||||
|
|
||||||
SUCCESS=0
|
SUCCESS=0
|
||||||
for H in ${REFS[@]}; do
|
for H in ${REFS[@]}; do
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue