Wrong file owners when pushing over HTTP
Created by: dfyx
Whenever someone pushes over HTTP, all new and changed files are assigned to the user gitlab
instead of git
. As a result of this the whole branch disappears for everybody who tries to pull/push over SSH.
Here's an example of which files were affected after I pushed a single commit.
$ sudo ls -lR /home/git/repositories/foo_bar.git/ | grep gitlab
drwxrws--- 2 gitlab gitlab 4096 Nov 6 11:44 1f
drwxrws--- 2 gitlab gitlab 4096 Nov 6 11:44 5d
drwxrws--- 2 gitlab gitlab 4096 Nov 6 11:44 a3
-r--r----- 1 gitlab gitlab 18 Nov 6 11:44 630bb0d3886c53b7535b4736d9ba2e35c090f8
-r--r----- 1 gitlab gitlab 176 Nov 6 11:44 47b655488b6562404d98fea656d41e8a1e2fb5
-r--r----- 1 gitlab gitlab 51 Nov 6 11:44 10adfebb3dfc43c9fdd056e7d0244a82eca858
-rw-rw---- 1 gitlab gitlab 41 Nov 6 11:44 master
When I clone over SSH afterwards
$ git clone [email protected]:foo_bar.git
Cloning into 'foo_bar'...
warning: You appear to have cloned an empty repository.
While over HTTP everything still works
$ git clone http://mydomain.com/foo_bar.git
Cloning into 'foo_bar'...
Username for 'http://mydomain.com':
Password for 'http://mydomain.com':
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 12 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (12/12), done.
To confirm that there isn't another problem I ran sudo chown -R git:git /home/git/repositories/
and everything worked fine again but of course this isn't a permanent solution.