HTTP commit changes owner of the committed branch from git to gitlab
Created by: elvanja
I have mixed SSH/HTTP access enabled for our Gitlab instance. It seems that HTTP commit changes owner of the git branch, which breaks SSH access to the repository / that branch.
How to reproduce:
- status for a project that was created and pushed to with SSH
$ dir -alh heads/master
returns:
-rw-rw---- 1 git git 41 Dec 3 14:10 heads/master
(execute this in the project repository on Gitlab instance)
- after HTTP commit we get:
-rw-rw---- 1 gitlab gitlab 41 Dec 3 14:13 heads/master
HTTP access will continue to work normally, but SSH fetch/pull will result in:
$ git fetch origin master
fatal: Couldn't find remote ref master
fatal: The remote end hung up unexpectedly
or
$ git fetch
Your configuration specifies to merge with the ref 'master'
from the remote, but no such ref was fetched.
Gitlab runs as gitlab user, so I suppose this has something to do with it. A dirty workaround is to change back ownership of repositories to git within a cron job. Is there a better way to fix this?
I am using latest stable release 3.1.0, and latest gitolite 3.x gitlab fork.