contrib/checkpatch: fix shallow repository for checkpatch script

The checkpatch test tests the patches on the merg-request, as they
branch off from master (or one of the stable branches).

It thus need the full git history, but the git repository might be a
shallow clone. Fix it.
This commit is contained in:
Thomas Haller 2020-11-10 16:56:39 +01:00
parent 45cb0ef403
commit 869ff96ad1
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -20,7 +20,9 @@ else
NM_UPSTREAM_REMOTE="nm-upstream-$(date '+%Y%m%d-%H%M%S')-$RANDOM"
git remote add "$NM_UPSTREAM_REMOTE" https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
BASE_REF="refs/remotes/$NM_UPSTREAM_REMOTE"
git fetch origin "$(git rev-parse "$HEAD")" --no-tags --unshallow
git fetch "$NM_UPSTREAM_REMOTE" \
--no-tags \
"refs/heads/master:$BASE_REF/master" \
"refs/heads/nm-*:$BASE_REF/nm-*" \
|| die "failure to fetch from https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git"