Skip to content

Commit 39353c0

Browse files
committed
tests: kdoc: fix warnings when new files are added
Use the git incantation we used for linters to avoid trying to include new files in the "before" counts. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent cb66c52 commit 39353c0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/patch/kdoc/kdoc.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ tmpfile_o=$(mktemp)
88
tmpfile_n=$(mktemp)
99
rc=0
1010

11-
files=$(git diff HEAD^ --pretty= --name-only)
11+
files_mod=$(git show --diff-filter=M --pretty="" --name-only "HEAD")
12+
files_all=$(git show --diff-filter=AM --pretty="" --name-only "HEAD")
1213

1314
HEAD=$(git rev-parse HEAD)
1415

1516
echo "Checking the tree before the patch"
1617
git checkout -q HEAD~
17-
./scripts/kernel-doc -Wall -none $files 2> >(tee $tmpfile_o >&2)
18+
./scripts/kernel-doc -Wall -none $files_mod 2> >(tee $tmpfile_o >&2)
1819

1920
incumbent=$(grep -v 'Error: Cannot open file ' $tmpfile_o | wc -l)
2021

2122
echo "Checking the tree with the patch"
2223

2324
git checkout -q $HEAD
24-
./scripts/kernel-doc -Wall -none $files 2> >(tee $tmpfile_n >&2)
25+
./scripts/kernel-doc -Wall -none $files_all 2> >(tee $tmpfile_n >&2)
2526

2627
current=$(grep -v 'Error: Cannot open file ' $tmpfile_n | wc -l)
2728

0 commit comments

Comments
 (0)