mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 12:38:10 +02:00
contrib/scripts: use "main" branch name in "checkpatch-feature-branch.sh"
(cherry picked from commit 172dace30d)
This commit is contained in:
parent
1b97be1f34
commit
f8624ea2e5
1 changed files with 4 additions and 4 deletions
|
|
@ -23,23 +23,23 @@ else
|
||||||
git fetch origin "$(git rev-parse "$HEAD")" --no-tags --unshallow
|
git fetch origin "$(git rev-parse "$HEAD")" --no-tags --unshallow
|
||||||
git fetch "$NM_UPSTREAM_REMOTE" \
|
git fetch "$NM_UPSTREAM_REMOTE" \
|
||||||
--no-tags \
|
--no-tags \
|
||||||
"refs/heads/master:$BASE_REF/master" \
|
"refs/heads/main:$BASE_REF/main" \
|
||||||
"refs/heads/nm-*:$BASE_REF/nm-*" \
|
"refs/heads/nm-*:$BASE_REF/nm-*" \
|
||||||
|| die "failure to fetch from https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git"
|
|| die "failure to fetch from https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# the argument is only a single ref (or the default "HEAD").
|
# the argument is only a single ref (or the default "HEAD").
|
||||||
# Find all commits that branch off one of the stable branches or master
|
# Find all commits that branch off one of the stable branches or main
|
||||||
# and lead to $HEAD. These are the commits of the feature branch.
|
# and lead to $HEAD. These are the commits of the feature branch.
|
||||||
|
|
||||||
RANGES=( $(git show-ref | sed 's#^\(.*\) '"$BASE_REF/"'\(master\|nm-1-[0-9]\+\)$#\1..'"$HEAD"'#p' -n) )
|
RANGES=( $(git show-ref | sed 's#^\(.*\) '"$BASE_REF/"'\(main\|nm-1-[0-9]\+\)$#\1..'"$HEAD"'#p' -n) )
|
||||||
|
|
||||||
[ "${#RANGES[@]}" != 0 ] || die "cannot detect git-ranges (HEAD is $(git rev-parse "$HEAD"))"
|
[ "${#RANGES[@]}" != 0 ] || die "cannot detect git-ranges (HEAD is $(git rev-parse "$HEAD"))"
|
||||||
|
|
||||||
REFS=( $(git log --reverse --format='%H' "${RANGES[@]}") )
|
REFS=( $(git log --reverse --format='%H' "${RANGES[@]}") )
|
||||||
|
|
||||||
if [ "${#REFS[@]}" == 0 ] ; then
|
if [ "${#REFS[@]}" == 0 ] ; then
|
||||||
# no refs detected. This means, $HEAD is already on master (or one of the
|
# no refs detected. This means, $HEAD is already on main (or one of the
|
||||||
# stable nm-1-* branches. Just check the patch itself.
|
# stable nm-1-* branches. Just check the patch itself.
|
||||||
REFS=( "$HEAD" )
|
REFS=( "$HEAD" )
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue