[I found the solution and describe it in my reply]
I migrated my gitolite server a while ago and upgraded from gitolite 2 to gitolite 3 in the same time. I just realized that while all repositories are working to fetch data, when trying to push on one of the repositories, I have the following error:
remote: Use of uninitialized value in do "file" at hooks/update line 36.
remote: Null filename used at hooks/update line 36.
remote: error: hook declined to update refs/heads/candidates/my-branch
I know that this error usually means that there is a ssh key or rights issue, but my gitolite.conf file is pretty simple and the ssh key is the same that works with the other repositories and that works to fetch from this server.
When I try to directly ssh the server with my ssh key, the following message is displayed:
PTY allocation request failed on channel 0
hello Fred, this is gitolite3@my-server running gitolite3 v3.6.2-26-gf9c0008 on git 1.9.1
R W repo1
R W repo2
R W gitolite-admin
Connection to my-server closed.
repo1 is the one not working, while repo2 and gitolite-admin both work well.
I don't really know where I should look next, to debug this.
update: I don't know if it can be related, but I noticed that the problematic repository directory on my server had different rights than the others (766 while the others where 700). I changed it with no results, but perhaps it can be a hint to something else?
update 2: Also, this problematic repository was created before the others. Could repositories created with older versions of git have a compatibility issue?
I managed to solve my issue.
I noticed that all working repositories had their HEAD file, branches directory, etc. in repo.git/.
, while the malfunctionning repo had all those in repo.git/.git/.
So I did the following:
cd ${GITOLITE_HOME}/repositories/repo.git
mv .git/* .
rm -rf .git
gitolite setup
and it started working.