Incorrect git repo path makes BrowserModule fail to load
|Reported by:||Owned by:||Peter Suter|
Proper error reporting for git repositories with invalid path.
- Navigate to
/admin/versioncontrol/repository/and add a new repository of type "git" with a directory that does not exist or is not a git repository, like "/tmp/"
- Save changes
When the page is reloaded, a yellow Trac warning will appear:
Warning: Error with navigation contributor "BrowserModule"
Additionally, the "Browse Source" tab in the nav bar will have vanished. If you navigate to
/browser/ directly, Trac will spit out an Internal Error: "GitError: GIT control files not found, maybe wrong directory?"
Note that when adding an invalid repository of type "svn", this does not happen. Instead, the Browse Source tab still exists and can be viewed without an internal error. When navigating to that page, the corresponding error will be displayed inline in the browser view: "/tmp/ does not appear to be a Subversion repository."
The Git backend should be made consistent with the SVN backend. As it is, it's hard for an admin to diagnose the user error, and a typo can bring down the whole BrowserModule.