Fix license check triggering on worktree root entry changes (#52902)
Kirill Bulatov
created
Had been seeing this for some time
<img width="1683" height="167" alt="bad"
src="https://github.com/user-attachments/assets/bd7370c9-617a-45c2-8785-ef268444f00a"
/>
and the culprit turned out to be the fact that the regex matched empty
strings.
The fix changes the regex to ensure it stops matching empty strings, and
patches the `log_err` callsite logic to avoid reading directories.
Release Notes:
- N/A