Yes, this particular UX is poor. It's not intuitive that clicking the filename has different behavior from clicking elsewhere in the file's row. Expanding the row inline needs a leading widget.
This particular issue is solved in GitHub proper, and derives from the Windows 95 tree view widget [1], which I seem to remember from Windows 3.x but can't find a screenshot.
The hover behavior is just not an intuitive or accessible default. I can't imagine someone being able to use this if they have a hard time clicking without moving the mouse. It also wastes resources fetching file/directory contents while the user is moving the cursor to a predetermined file they presumably wish to open.