Fix license check triggering on worktree root entry changes (#52902)

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
43ea97a2e5Kirill Bulatov committed on 4/1/2026, 9:21:02 PM· committed by GitHubparentefb12d2
1 file changedLine totals unavailable