From 869ff96ad19645761702dd73bb6fcaaf69c26a11 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 10 Nov 2020 16:56:39 +0100 Subject: [PATCH] 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. --- contrib/scripts/checkpatch-feature-branch.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/scripts/checkpatch-feature-branch.sh b/contrib/scripts/checkpatch-feature-branch.sh index 292a429109..c46fcd4b5a 100755 --- a/contrib/scripts/checkpatch-feature-branch.sh +++ b/contrib/scripts/checkpatch-feature-branch.sh @@ -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"