diff options
author | Thomas Haller <thaller@redhat.com> | 2018-10-22 13:35:20 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-10-22 13:35:20 +0200 |
commit | 4543785438c5859799e9c68b80e63e30be5df82e (patch) | |
tree | dcc2a6adf4dc24e7e59414ab42fe0b961848a568 /contrib | |
parent | 31f13acdc994470cf57ab3fc722ae23539be8c0c (diff) | |
download | NetworkManager-4543785438c5859799e9c68b80e63e30be5df82e.tar.gz |
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.
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/scripts/checkpatch-feature-branch.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/scripts/checkpatch-feature-branch.sh b/contrib/scripts/checkpatch-feature-branch.sh index 6741317be2..2e0b589194 100755 --- a/contrib/scripts/checkpatch-feature-branch.sh +++ b/contrib/scripts/checkpatch-feature-branch.sh @@ -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[@]}" != 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 for H in ${REFS[@]}; do |