gitlabhq/gitlabhq — pull request #4911 by jackeri (2013-08-26 20:35:14+00:00)
Title: Importing repositories generated empty repos

There are multiple issues on this problem but one example is #3693
I checked out the 6.0 stable and the issue seemed to be there as well, even tho the issue pages mostly talk about older releases.

If I imported a repository straight from the gitlab repository directory (~/repository/repo.gi) it would have been set as admin project and all the data would be reseted, basically making it an empty repository. I fix the issue by moving the folder to the correct folder before creating the project to gitlab.

Also there was an issue that if I added a repository to a users folder (~/repository/user.name/repo.git) it would not be added as the importer only tried to check/create groups. I added the checks to see if the folder is an existing users or groups folder and also set the owner of the repo to the user owning the group or the user itself.

This could be cherry picked to the master as well i believe, I just needed it at the 6-0 stable as that is what we started using.