This may or may not happen for different sessions inside the same repository.
The tree is empty, shows GIT TREE COMPARE: NONE.
When refreshing inside a repository the following can be seen in output tab:
Using git from C:\Program Files\Git\cmd\git.exe
Ignoring irrelevant change: c:\repos\REPO\.git\objects
Ignoring irrelevant change: c:\repos\repo\.git\logs\refs\remotes\origin\main
Ignoring irrelevant change: c:\repos\repo\.git\FETCH_HEAD
Updating the git tree failed: The "path" argument must be of type string. Received undefined
Finally figured out why this happens!
Turns out Git Tree Compare is case-sensitive on Windows.
The repository is in c:\repos\REPO.
If I launch with code c:\repos\REPO, it works.
When I launch with code c:\repos\repo, it doesn't.
If this can't be worked around, perhaps the error message could hint to this behaviour?