Skip to content

Commit 3daca41

Browse files
committed
scripts/check-patches-apply.py: Fix strip value for refs with a slash
For refs with a slash in them, such as the arm64 refs 'for-next/core' and 'for-next/fixes', the tarball will be formatted like: for-next/core/Makefile for-next/core/arch/... which causes an incorrect layout with the current value of 1 and patches that would normally apply correctly fail to do so. The strip value for the above scenario needs to be 2 to allow the patches to apply correctly. Use the length of the list created by splitting on slashes as the strip value so that the layout is consistent for patch application. Signed-off-by: Nathan Chancellor <[email protected]>
1 parent de47851 commit 3daca41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/check-patches-apply.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ->
5353
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot/linux-master.tar.gz
5454
tarball_url = f"{args.repo}/snapshot/{base_repo}-{args.ref}.tar.gz"
55-
strip = 1
55+
strip = len(args.ref.split('/'))
5656
elif 'googlesource.com' in args.repo:
5757
tarball_url = f"{args.repo}/+archive/refs/heads/{args.ref}.tar.gz"
5858
strip = 0

0 commit comments

Comments
 (0)