We run Redmine together with Gitolite and view the repositories within Redmine. After an update of Redmine and GIT some repositories would randomly show a 404 error or only display one of many branches.
Redmine retrieves the GIT log by calling "git --git-dir DIRECTORY log". I found out under which user Passenger runs and called this command under this user. It showed "fatal: failed to read object [...]: Permission denied" or "fatal: bad default revision 'HEAD'", so I was sure that there is a permission issue. I changed the permissions on the repository recursively. It's also necessary to change the UMASK of Gitolite in this case. It's in .gitolite.rc. This file has obviously been overwritten by the update of Gitolite.