Handle tmp refs properly
We create refs inside refs/tmp/
in most cases we remove them afterwords but in this case https://gitlab.com/gitlab-org/gitlab-ce/blob/1bf57b75119deb79f5826245d4c69a0a83cc4864/app/services/compare_service.rb#L19 we don't
These refs don't create a big problem itself but they prevent git gc
from removing unnecessary objects as they hold reference.
Proposed TODO:
- Handle them properly in this case.
- Create task to remove old ones or at least write some docs
CE repo in GitLab.com contains 2439 of these references. Not that bad by the way.