Commit d2d2574
authored
refactor(files): simplify file filtering and default to text (#1541)
- Remove filetype-based filtering from file list, now only filters out
empty entries.
- Add simple binary detection in get_file by rejecting files with null
bytes.
- filetype() now defaults to 'text' if detection fails, letting content
validation handle unreadable files.
This improves robustness and performance by avoiding unnecessary
filetype checks and handling binary files more gracefully.
Closes #15331 parent ca9a428 commit d2d2574
2 files changed
+14
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 14 | + | |
28 | 15 | | |
| 16 | + | |
29 | 17 | | |
30 | 18 | | |
31 | 19 | | |
| |||
268 | 256 | | |
269 | 257 | | |
270 | 258 | | |
271 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
272 | 266 | | |
273 | 267 | | |
274 | 268 | | |
| |||
0 commit comments