Skip to contentSkip to conversation

devtools: fix file listing in maintainers check

PATCH Applied Thomas Monjalon 1 participant 2 messages Jun 15, 2021 – Jun 23, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devtools: fix file listing in maintainers check

When having multiple working trees, the main one has a .git directory while attached trees have a .git file.
Thus the git check should work for both file and directory.

In the case there is no working tree (.git not readable), the command "find" is used and should be able to list paths with wildcards. Wildcards work only as shell expansion in the case of file paths, so the quotes must be removed.

Fixes 27c2ce563216 ("maintainers: start a Linux-style file")
---
 devtools/check-maintainers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
devtools/check-maintainers.sh +2 -2
index df3f740b6e..71697bb352 100755
@@ -15,10 +15,10 @@ files () # <path> [<path> ...]
 	if [ -z "$1" ] ; then
 		return
 	fi
-	if [ -d .git ] ; then
+	if [ -r .git ] ; then
 		git ls-files "$1"
 	else
-		find "$1" -type f |
+		find $1 -type f |
 		sed 's,^\./,,'
 	fi |
 	# if not ended by /
Signature · 1 line
2.31.1
author Applied
#1 lore raw

15/06/2021 14:49, Thomas Monjalon:

Quoted 9 lines

When having multiple working trees, the main one has a .git directory while attached trees have a .git file.
Thus the git check should work for both file and directory.

In the case there is no working tree (.git not readable), the command "find" is used and should be able to list paths with wildcards. Wildcards work only as shell expansion in the case of file paths, so the quotes must be removed.

Quoted 4 lines
Fixes 27c2ce563216 ("maintainers: start a Linux-style file")

Applied