File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -166,11 +166,21 @@ async def execute(
166166 # Use grep to filter out target directory, then check each remaining directory
167167 if list_files_args .recursive :
168168 # Filter out the target directory upfront, then check git ignore status
169- dirs_command = f"find { target_dir } -xdev -type d | grep -v '^{ escaped_target_dir } $' | while read -r dir; do git check-ignore \" $dir/\" >/dev/null || echo \" $dir\" ; done | sort"
169+ # Suppress stderr from git check-ignore to avoid fatal messages leaking into output
170+ dirs_command = (
171+ f"find { target_dir } -xdev -type d | "
172+ f"grep -v '^{ escaped_target_dir } $' | "
173+ f"while read -r dir; do git check-ignore \" $dir/\" >/dev/null 2>&1 || echo \" $dir\" ; done | sort"
174+ )
170175 if ignore_pattern :
171176 dirs_command += ignore_pattern
172177 else :
173- dirs_command = f"find { target_dir } -xdev -maxdepth 1 -type d | grep -v '^{ escaped_target_dir } $' | while read -r dir; do git check-ignore \" $dir/\" >/dev/null || echo \" $dir\" ; done | sort"
178+ # Suppress stderr from git check-ignore to avoid fatal messages leaking into output
179+ dirs_command = (
180+ f"find { target_dir } -xdev -maxdepth 1 -type d | "
181+ f"grep -v '^{ escaped_target_dir } $' | "
182+ f"while read -r dir; do git check-ignore \" $dir/\" >/dev/null 2>&1 || echo \" $dir\" ; done | sort"
183+ )
174184 if ignore_pattern :
175185 dirs_command += ignore_pattern
176186 else :
You can’t perform that action at this time.
0 commit comments