Scan repositories for temp git objects with no permissions
In https://gitlab.com/gitlab-com/support-forum/issues/2418, users were unable to fork the gitlab-org/gitlab-ee repository due to a bad file:
$ sudo ls -al /var/opt/gitlab/git-data-file02/repositories/gitlab-org/gitlab-ee.git/objects/tmp_object_git2_x2SXgm
---------- 1 git git 0 Jun 5 1981 /var/opt/gitlab/git-data-file02/repositories/gitlab-org/gitlab-ee.git/objects/tmp_object_git2_x2SXgm
A clone would result in a bad file:
$ git clone /var/opt/gitlab/git-data-file02/repositories/gitlab-org/gitlab-ee.git /tmp/test-clone
Cloning into '/tmp/test-clone'...
fatal: failed to copy file to '/tmp/test-clone/.git/objects/tmp_object_git2_x2SXgm': Permission denied
$ fatal: The remote end hung up unexpectedly
Repositories that have these files will not be cloneable. We should consider walking the filesystem for files that have odd permissions as above.